示例#1
0
 public function create($data = array())
 {
     parent::create($data);
     if ($this->newDoc) {
         $this->set('createdon', time());
     }
     return $this;
 }
示例#2
0
 public function __construct($modx, $debug = false)
 {
     parent::__construct($modx, $debug);
     if (empty($this->default_field)) {
         $data = $this->modx->db->getTableMetaData($this->makeTable($this->table));
         foreach ($data as $item) {
             if (empty($this->pkName) && $item['Key'] == 'PRI') {
                 $this->pkName = $item['Field'];
             }
             if ($this->pkName != $item['Field']) {
                 $this->default_field[$item['Field']] = $item['Default'];
             }
         }
         $this->generateField = true;
     }
 }
示例#3
0
 public function create($data = array())
 {
     parent::create($data);
     $this->set('createdby', null)->set('editedby', null)->set('createdon', time())->touch();
     return $this;
 }