예제 #1
0
 public static function extendsModelDefinition(DataModel_Definition $oDef)
 {
     // var_dump('Test_DataModel_User_EmailAddress_Ext::extendsModelDefinition() called');
     $oDef->addField('emailAddress');
     $oDef->addFakeField('hasEmailAddress')->setDefaultValue(false);
 }
예제 #2
0
 public function __construct(DataModel_Definition $oDef, $fieldName)
 {
     constraint_mustBeString($fieldName);
     $this->name = $fieldName;
     $this->modelName = $oDef->getModelName();
     // we must always have a type
     // users can override this if they wish
     $this->oType = new DataModel_Type_Generic();
 }
예제 #3
0
 public static function extendsModelDefinition(DataModel_Definition $oDef)
 {
     $oDef->addField('verified')->setDefaultValue(0);
     $oDef->addField('verificationCode');
 }
예제 #4
0
 public function beDeleteStatement(DataModel_Definition $oDef, Datastore_Storage $oMap)
 {
     $table = $oMap->getTable();
     $primaryKey = $oDef->getPrimaryKey();
     $this->sql = "delete from {$table} where ";
     $append = false;
     foreach ($primaryKey as $field) {
         if ($append) {
             $this->sql .= ' and ';
         }
         $this->sql .= $field . ' = ?';
         $append = true;
     }
     $this->returnRows = false;
     $this->fieldsToBind = $primaryKey;
 }