/** * Get the properties on this source * @param boolean $parsed * @return array */ public function getProperties($parsed = false) { $properties = $this->get('properties'); $defaultProperties = $this->getDefaultProperties(); if (!empty($properties) && is_array($properties)) { foreach ($properties as &$property) { $property['overridden'] = 0; if (array_key_exists($property['name'], $defaultProperties)) { if ($defaultProperties[$property['name']]['value'] != $property['value']) { $property['overridden'] = 1; } } else { $property['overridden'] = 2; } } $properties = array_merge($defaultProperties, $properties); } else { $properties = $defaultProperties; } /** @var array $results Allow manipulation of media source properties via event */ $results = $this->xpdo->invokeEvent('OnMediaSourceGetProperties', array('properties' => $this->xpdo->toJson($properties))); if (!empty($results)) { foreach ($results as $result) { $result = is_array($result) ? $result : $this->xpdo->fromJSON($result); $properties = array_merge($properties, $result); } } if ($parsed) { $properties = $this->parseProperties($properties); } return $this->prepareProperties($properties); }