phpcr/src/PHPCR/Security/PrincipalInterface.php

Show: PublicProtectedPrivateinherited
    Table of Contents
    This file is part of the PHPCR API

    This file in particular is derived from the Principal interface of the package java.security. For more information about the Java interface have a look at http://docs.oracle.com/javase/6/docs/api/index.html?java/security/Principal.html

    Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0
    

    Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

    License
    Apache Software License 2.0  
    Link
    http://phpcr.github.com/  

    \PHPCR\Security\PrincipalInterface

    Package: Default
    As there are no ACL standard interfaces in PHP this interface provides the Principal interface similar to the java.security.Principal

    The Principal is any entity that can be assigned privileges. E.g. a person, a role, a computer.

    The reason to have this interface is that the PHPCR implementation needs to store the principals and use them on later requests.

    Api
     

    Methods

    methodpublicequals(mixed $object) : boolean

    Compares this principal to the passed object.

    Returns true if both this principal and the passed object match the same thing.

    This is necessary, as the same hashCode does not guarantee equality, and the === operator is too strict, as there could be two instances of the same principal.

    Parameters
    NameTypeDescription
    $objectmixed
    Returns
    TypeDescription
    booleantrue if the principal passed to the method is the same as this object
    methodpublicgetName() : string

    Returns the name of this principal.

    Returns
    TypeDescription
    stringname of this principal
    methodpublichashCode() : int

    The hash code must be the same for the same principal.

    However it should be unique inside your application for different principals.

    Returns
    TypeDescription
    inta hashcode for this principal.
    Documentation was generated by phpDocumentor 2.0.0a12.