public function hydrate(array $data = array()) { parent::hydrate($data); if (isset($data['intervention'])) { $this->intervention = new Intervention(); if (!is_array($data['intervention'])) { throw new \Bixev\Rest\Exception\Rest\E400BadRequest('Invalid parameter "intervention"'); } $this->intervention->hydrate($data['intervention']); } if (isset($data['custom_fields'])) { $this->custom_fields = new InterventionReportCustomFields(); if (!is_array($data['custom_fields'])) { throw new \Bixev\Rest\Exception\Rest\E400BadRequest('Invalid parameter "custom_fields"'); } $this->custom_fields->hydrate($data['custom_fields']); } }