Exemple #1
0
 /**
  *  @see SqlMapper::__set($key, $value);
  */
 function __set($key, $value)
 {
     if ($key == "password") {
         $value = Bcrypt::instance()->hash($value, $this->createSalt(), 14);
     }
     parent::__set($key, $value);
 }
Exemple #2
0
 function __construct()
 {
     parent::__construct(new DB\SQL("sqlite:/tmp/test.sqlite"), "MyTest");
     $this->properties = array("mybool" => array("type" => "Boolean"), "mycolor" => array("type" => "Color"), "myemail" => array("type" => "Email"), "myfloat" => array("type" => "Float"), "myint" => array("type" => "Integer"), "mynumeric" => array("type" => "Numeric"), "mytext" => array("type" => "Text"));
 }
Exemple #3
0
 /**
  *  @see SqlMapper::__construct($db, $table, $ttl)
  */
 function __construct($db, $table = "groups", $ttl = 60)
 {
     parent::__construct($db, $table, $ttl);
     $this->properties = array("id" => array("type" => "Integer"), "name" => array("type" => "Text"));
 }