/** * * @param BaseACL $acl * @param array $reachable * @return boolean */ protected function findInMap(BaseACL $acl, array $reachable) { foreach ($reachable as $role) { if ($acl->getType()->equal($role->getRole())) { return true; } } return false; }
/** * @inheritDoc */ public function transform($value) { if (null === $value || empty($value)) { return json_encode(array()); } if (is_object($this->acl) && method_exists($this->acl, 'getType')) { $entity = $this->entityMgr->getRepository($this->acl->getType()->getClassMatch())->find($value); if (!$entity) { return json_encode(array()); } } else { throw new TransformationFailedException("Unable to transform {$value} to any acl role type"); } return json_encode(array(array('id' => $value, 'name' => $entity->__toString()))); }