コード例 #1
0
 /**
  * Hooks get() to impose representation-level access control
  *
  * @param string $ps_field The bundle to fetch value(s) for
  * @param array optional list of get() options
  * @return mixed A return value - either a scalar or array
  */
 public function get($ps_field, $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::get($ps_field, $pa_options);
 }