/** * Returns a URL for a media version in a media field. * * @param string $ps_field The field to fetch media from * @param string $ps_version The media version to fetch * @param array $pa_options Optional array of options. Options are: * index = if media repeats, indicates the position of the value to return. The index is zero-based. * checkAccess = array of access values to restrict returned values to. */ public function getMediaUrl($ps_field, $ps_version, $pa_options = null) { $va_tmp = explode('.', $ps_field); $va_check_access = isset($pa_options['checkAccess']) ? $pa_options['checkAccess'] : null; if ($va_tmp[0] === 'ca_object_representations' && $va_tmp[1] !== 'access') { if (!$this->_haveAccessToRepresentation($va_check_access)) { return null; } } return parent::getMediaUrl($ps_field, $ps_version, isset($pa_options['index']) ? $pa_options['index'] : 0, $pa_options); }