Exemplo n.º 1
0
 /**
  * Constructs a new scaffold form
  * @param string $action URL where this form will point to
  * @param zibo\library\orm\model\Model $model Model of the data on the form
  * @param mixed $data Data object of the model to preset the form
  * @param array $fields Array with the names of the fields which need to be added to the form. If not provided, all the fields of the model will be added
  * @param boolean $skipFields Set to true to skip the provided fields instead of adding them
  * @return null
  */
 public function __construct($action, Model $model, $data = null, array $fields = null, $skipFields = false)
 {
     if ($data == null) {
         $data = $model->createData();
     }
     $this->isConstructing = true;
     parent::__construct($action, self::NAME . $model->getName(), $data);
     $this->isConstructing = false;
     $this->dataFieldNames = array();
     $this->addFieldsToForm($model, $fields, $skipFields);
 }
Exemplo n.º 2
0
 /**
  * Constructs a new result parser
  * @param zibo\library\orm\model\Model $model Model of this result
  * @return null
  */
 public function __construct(Model $model)
 {
     $this->meta = $model->getMeta();
     $this->data = $model->createData(false);
 }