setType() public method

Set type
public setType ( string $type ) : Newscoop\Entity\Acl\Rule
$type string
return Newscoop\Entity\Acl\Rule
 /**
  * Save rule
  *
  * @param array $values
  * @param bool $isUser
  * @param \Newscoop\Entity\Acl\Rule|null $rule
  * @return \Newscoop\Entity\Acl\Rule|null
  */
 public function save(array $values, $isUser = false, Rule $rule = null)
 {
     $role = $this->getEntityManager()->getReference('Newscoop\\Entity\\Acl\\Role', (int) $values['role']);
     $resource = (string) $values['resource'];
     $action = (string) $values['action'];
     $type = array_key_exists('type', $values) && strtolower($values['type']) == 'allow' ? 'allow' : 'deny';
     $conflicts = $this->findBy(array('role' => (int) $values['role'], 'resource' => $resource, 'action' => $action));
     foreach ($conflicts as $conflict) {
         $this->getEntityManager()->remove($conflict);
     }
     $this->getEntityManager()->flush();
     if ('deny' == $type && !$isUser) {
         // don't add deny rules for user groups
         return;
     }
     if (null === $rule) {
         $rule = new Rule();
     }
     $rule->setType($values['type']);
     $rule->setRole($role);
     $rule->setResource($resource);
     $rule->setAction($action);
     $this->getEntityManager()->persist($rule);
     $this->getEntityManager()->flush();
     return $rule;
 }
 public function setType($type)
 {
     $this->__load();
     return parent::setType($type);
 }