Beispiel #1
0
 /**
  * @return Group
  */
 public function even()
 {
     $group = Group::create();
     foreach ($this->toArray() as $index => $item) {
         if (!($index & 1)) {
             $group->append($item);
         }
     }
     return $group;
 }
Beispiel #2
0
 /**
  * @param string $name
  * @return Group
  */
 public function getGroup($name)
 {
     if (isset($this->groups[$name])) {
         return $this->groups[$name];
     }
     return $this->groups[$name] = Group::createWithName($name);
 }