public function loadFromRawData($data, $reset = false) { if ($reset) { $this->initValues(); } $excluded_properties = array('product', 'developer', 'organization'); foreach (array_keys($data) as $property) { if (in_array($property, $excluded_properties)) { continue; } // form the setter method name to invoke setXxxx $setter_method = 'set' . ucfirst($property); if (method_exists($this, $setter_method)) { $this->{$setter_method}($data[$property]); } else { self::$logger->notice('No setter method was found for property "' . $property . '"'); } } if (isset($data['organization'])) { $organization = new Organization($this->config); $organization->loadFromRawData($data['organization']); $this->organization = $organization; } if (isset($data['product'])) { $product = new Product($this->config); $product->loadFromRawData($data['product']); $this->products[] = $product; } if (isset($data['developer'])) { $developer = new Developer($this->config); $developer->loadFromRawData($data['developer']); $this->developer = $developer; } }