Пример #1
0
 /**
  * Function to set POST parameters onto the request
  *
  * @param array $params Key value array of post params
  */
 public function setPostParameters($params = array())
 {
     foreach ($params as $key => $value) {
         $this->request->setPostField($key, $value);
     }
 }
Пример #2
-1
 /**
  * Function to set the entities properties on the
  * request object taking into account any properties that
  * are read only etc.
  *
  * @param  \Trucker\Resource\Model
  */
 public function setModelProperties(Model $model)
 {
     $cantSet = $model->getReadOnlyFields();
     //set the property attributes
     foreach ($model->attributes() as $key => $value) {
         if (in_array($key, $model->getFileFields())) {
             $this->request->addPostFile($key, $value);
         } else {
             if (!in_array($key, $cantSet)) {
                 $this->request->setPostField($key, $value);
             }
         }
     }
 }