Exemple #1
0
 /**
  * Register new meta type, registration is required before setting new value for meta.
  *
  * @param Meta|null $meta Meta object
  *
  * @throws \Exception if already registered
  *
  * @return bool if registered successfully
  */
 public function registerMeta(Meta $meta = null)
 {
     $configuration = $meta->getConfiguration();
     $name = $configuration['name'];
     if (!array_key_exists($name, $this->registeredMeta)) {
         $this->registeredMeta[$name] = $configuration;
         if (!is_null($meta)) {
             $this->{$name} = $meta;
         }
         return true;
     }
     return false;
 }
 public function let(Cache $cache, Meta $meta)
 {
     $meta->getConfiguration()->willReturn(['name' => 'article']);
     $this->beConstructedWith($cache, __DIR__ . '/../Meta/Resources/meta');
 }