コード例 #1
0
ファイル: Manager.php プロジェクト: rabbitcms/settings
 /**
  * Add new settings meta info.
  *
  * @param Meta $meta
  */
 public function addMeta(Meta $meta)
 {
     $group = $meta->getGroup();
     if (!$this->groups->has($group)) {
         $this->groups->put($group, new Collection());
     }
     if ($this->all->has($meta->getName())) {
         throw new \RuntimeException('Settings with name `' . $meta->getName() . '` already exists .');
     }
     $this->all->put($meta->getName(), $meta);
     //$this->groups->get($group);
     $this->groups->get($group)->put($meta->getName(), $meta);
 }
コード例 #2
0
 /**
  * Add a Group instance to the Menu
  *
  * @param Group $group
  *
  * @return $this
  */
 public function addGroup(Group $group)
 {
     $this->groups->put($group->getName(), $group);
     return $this;
 }