예제 #1
0
 public static function nextId()
 {
     if (DbIDGenerator::$idgenerator == null) {
         DbIDGenerator::$idgenerator = new DbIDGenerator();
     }
     return DbIDGenerator::$idgenerator->getNextID();
 }
예제 #2
0
    public function afterConstruct($event) { 

        Yii::import('system.vendors.lifei.DbIDGenerator');

        if($this->owner->isNewRecord && $this->owner->getPrimaryKey() == NULL) {
            $this->owner->setPrimaryKey(DbIDGenerator::nextId());
        }
    } 
예제 #3
0
파일: CEntity.php 프로젝트: njxjxj/yorm
 protected function afterConstruct()
 {
     parent::afterConstruct();
     if ($this->isNewRecord && $this->getPrimaryKey() == NULL) {
         $this->setPrimaryKey(DbIDGenerator::nextId());
     }
 }