public function setEntity($entity_id)
    {
        if ($entity_id instanceof Entity)
        {
            $this->entity = $entity_id;
            $entity_id = $entity_id->getID();
        }
        elseif (!is_scalar($entity_id))
            throw new Exception("Entity-ID must be an Entity or a scalar");

        if ($entity_id !== $this->entity_id)
        {
            $this->entity_id = $entity_id;
            $this->changed = true;
        }
    }
public function setEntity($entity_id)
    {
        if ($entity_id instanceof Entity)
        {
            $this->entity = $entity_id;
            $entity_id = $entity_id->getID();
        }
        elseif (!is_scalar($entity_id))
            throw new Exception("Entity-ID must be an Entity or a scalar");

        if ($entity_id !== $this->entity_id)
        {
            $this->entity_id = $entity_id;
            $this->changed = true;
        }
    }
public function setEntity ( $ entity_id ) { if ( $ entity_id instanceof Entity ) { $ this -> entity = $ entity_id ; $ entity_id = $ entity_id -> getID ( ) ; } elseif ( ! is_scalar ( $ entity_id ) ) throw new Exception ( "Entity-ID must be an Entity or a scalar" ) ; if ( $ entity_id !== $ this -> entity_id ) { $ this -> entity_id = $ entity_id ; $ this -> changed = true ; } }
Set the entity this Rule applies to

@param scalar|Entity $entity_id Either a Entity object or a Role-ID
@throws Wedeto\ACL\Exception When the entity is not a Entity object or a scalar
Set the entity this Rule applies to