create first method for CRUD

This commit is contained in:
Manuel Raynaud
2013-01-09 17:23:46 +01:00
parent 4e21c25867
commit c5bed85462
6 changed files with 233 additions and 12 deletions

View File

@@ -6,9 +6,23 @@ use Thelia\Model\Base\Base;
class Config extends Base
{
protected $name;
protected $value;
protected $secure;
protected $hidden;
protected $properties = array(
"name",
"value",
"secure",
"hidden"
);
public function read($search, $default)
{
return $this->db->config()->where("name",$search)->fetch()?:$default;
$result = $this->findOneBy("name",$search);
return $result ? $result->name : $default;
}
}