src/Alchemy/Component/Cerberus/Model/Base/Role.php
public function addPermission(ChildPermission $permission)
    {
        if ($this->collPermissions === null) {
            $this->initPermissions();
        }

        if (!$this->getPermissions()->contains($permission)) {
            // only add it if the **same** object is not already associated
            $this->collPermissions->push($permission);
            $this->doAddPermission($permission);
        }

        return $this;
    }
public function addPermission(ChildPermission $permission)
    {
        if ($this->collPermissions === null) {
            $this->initPermissions();
        }

        if (!$this->getPermissions()->contains($permission)) {
            // only add it if the **same** object is not already associated
            $this->collPermissions->push($permission);
            $this->doAddPermission($permission);
        }

        return $this;
    }
public function addPermission ( ChildPermission $ permission ) { if ( $ this -> collPermissions === null ) { $ this -> initPermissions ( ) ; } if ( ! $ this -> getPermissions ( ) -> contains ( $ permission ) ) { // only add it if the **same** object is not already associated $ this -> collPermissions -> push ( $ permission ) ; $ this -> doAddPermission ( $ permission ) ; } return $ this ; }
Associate a ChildPermission to this object
through the role_permission cross reference table.

@param ChildPermission $permission
@return ChildRole The current object (for fluent API support)
Associate a ChildPermission to this object through the role_permission cross reference table .