build() public method

Builds schema object properties.
public build ( array $data ) : void
$data array Loaded object properties.
return void
Esempio n. 1
0
 /**
  * Overwritten to change $this->path when it's been specifically given in the first parameter
  * CakePHP has a problem where it would override the path if it's a plugin, without checking if it was specified
  */
 public function build($data)
 {
     parent::build($data);
     if (!empty($data['path'])) {
         $this->path = $data['path'];
     }
 }
 /**
  * Return CakeSchema object for given Schema name
  *
  * @return CakeSchema
  */
 protected function _schema()
 {
     if ($this->_Schema) {
         return $this->_Schema;
     }
     $db = ConnectionManager::getDataSource($this->useDbConfig);
     $this->_Schema = new CakeSchema(array('connection' => $db));
     $this->_Schema->build(array($this->_tableName() => $this->_schema));
     Cache::drop('_cake_model_');
     $db->cacheSources = false;
     $db->reconnect();
     return $this->_Schema;
 }