Exemple #1
0
 /**
  * @param \Restyii\Client\Schema\Attribute[] $attributes
  */
 public function setAttributes($attributes)
 {
     foreach ($attributes as $name => $attribute) {
         if (!$attribute instanceof Attribute) {
             $attributes[$name] = new Attribute($attribute);
             $attributes[$name]->name = $name;
         }
     }
     if (!$attributes instanceof \CAttributeCollection) {
         $c = new \CAttributeCollection();
         $c->caseSensitive = true;
         $c->copyFrom($attributes);
         $attributes = $c;
     }
     $this->_attributes = $attributes;
 }
Exemple #2
0
 /**
  * Sets the parameters for the action
  * @param \Restyii\Client\Schema\Parameter[] $params
  */
 public function setParams($params)
 {
     foreach ($params as $name => $param) {
         if (!$param instanceof Parameter) {
             $params[$name] = new Parameter($param);
             $params[$name]->name = $name;
         }
     }
     if (!$params instanceof \CAttributeCollection) {
         $c = new \CAttributeCollection();
         $c->caseSensitive = true;
         $c->copyFrom($params);
         $params = $c;
     }
     $this->_params = $params;
 }