original_string: public function policy( Policy $policy )
  	{
  		$this->loadedPolicies[] = $policy;
  
  		// Caches the policy nodes as a nestable tree
  		foreach ( $policy->getNodes() as $namespace => $callable )
  			$this->getPermission( $namespace )->addPolicyMethod( $callable );
  	}
code: public function policy( Policy $policy )
  	{
  		$this->loadedPolicies[] = $policy;
  
  		// Caches the policy nodes as a nestable tree
  		foreach ( $policy->getNodes() as $namespace => $callable )
  			$this->getPermission( $namespace )->addPolicyMethod( $callable );
  	}
code_tokens: public function policy ( Policy $ policy ) { $ this -> loadedPolicies [ ] = $ policy ; // Caches the policy nodes as a nestable tree foreach ( $ policy -> getNodes ( ) as $ namespace => $ callable ) $ this -> getPermission ( $ namespace ) -> addPolicyMethod ( $ callable ) ; }
docstring: Adds a new policy checker.
  
  Policies are checked for permissions before they are checked by the general permission backend
  
  @param Policy $policy
docstring_tokens: Adds a new policy checker .