/** * Constructor * * @param object $raw_data Object's data * @param \SeeClickFix\Core\Proxy $proxy Object's proxy */ public function __construct($raw_data, \SeeClickFix\Core\Proxy $proxy = null, $filterString = null) { // Haystack it! $filter = explode(',', $filterString); // Filter out unused request types foreach ($raw_data->request_types as $key => $requestType) { if (preg_match("/\\/(\\d+)\$/", $requestType->url, $matches)) { $raw_data->request_types[$key]->id = $matches[1]; if ($filterString && !in_array($raw_data->request_types[$key]->id, $filter)) { unset($raw_data->request_types[$key]); } } } // Call parent parent::__construct($raw_data, $proxy); }
/** * Add data * * Add data from another collection the this collection * * @param \SeeClickFix\Collection\CollectionAbstract $object Object to add the data of */ public function addData(\SeeClickFix\Collection\CollectionAbstract $object) { $this->data = array_merge($this->data, $object->getData()); }