Art4\JsonApiClient\Utils\DataContainerInterface::set PHP Method

set() public method

Set a value
public set ( string $key, mixed $value ) : self
$key string The Key
$value mixed The Value
return self
    public function set($key, $value);

Usage Example

Beispiel #1
0
 /**
  * Add a new value to the meta element and creates it if not exists
  * @param $key
  * @param $value
  */
 public function addMetaData($key, $value)
 {
     if ($this->has('meta')) {
         $this->get('meta')->set($key, $value);
     } else {
         $this->container->set('meta', $this->manager->getFactory()->make('Meta', [(object) [$key => $value], $this->manager]));
     }
 }
All Usage Examples Of Art4\JsonApiClient\Utils\DataContainerInterface::set
DataContainerInterface