list[] = array( 'type' => $type, 'place' => $place, 'value' => $value, ); } public function getStyles() { return $this->filterListByType(self::TYPE_STYLES); } public function getBlocks() { return $this->filterListByType(self::TYPE_BLOCKS); } public function setList(array $list) { $this->list = []; foreach ($list as $item) { $this->add($item['type'], $item['place'], $item['value']); } return $this; } public function getList() { return $this->list; } protected function filterListByType($type) { $result = array(); foreach ($this->list as $item) { if ($item['type'] != $type) { continue; } //$result[$item['code']] = $item['value']; $result[] = $item; } return $result; } }