Ejemplo n.º 1
0
 /**
  * Set record
  *
  * @param Phifty\Model $record
  */
 public function setRecord(BaseModel $record)
 {
     $this->record = $record;
     // Convert id column object from record schema to
     // Action param object.
     if ($column = $this->record->getColumn('id')) {
         if (!isset($this->params[$column->name])) {
             $this->params[$column->name] = ColumnConvert::toParam($column, $record, $this);
         }
     }
     // build relationship config from model schema
     if ($relations = $this->record->getSchema()->relations) {
         foreach ($relations as $rId => $relation) {
             $this->addRelation($rId, $relation);
         }
     }
 }