Kronolith_Attendee::__construct PHP Méthode

__construct() public méthode

Constructor.
public __construct ( array $params )
$params array Attendee properties: - 'user': (string) A user name. - 'email': (string) The email address of the attendee. - 'role': (integer) The role code of the attendee. One of the Kronolith::PART_* constants. Default: Kronolith::PART_REQUIRED - 'response': (integer) The response code of the attendee. One of the Kronolith::RESPONSE_* constants. Default: Kronolith::RESPONSE_NONE - 'name': (string) The name of the attendee. - 'identities': (Horde_Core_Factory_Identity) An identity factory used to complete 'email' and 'name' for 'user' if not specified explicitly.
    public function __construct($params)
    {
        $params = array_merge(array('user' => null, 'email' => null, 'role' => Kronolith::PART_REQUIRED, 'response' => Kronolith::RESPONSE_NONE, 'name' => null), $params);
        $this->user = $params['user'];
        $this->email = $params['email'];
        $this->name = $params['name'];
        $this->role = $params['role'];
        $this->response = $params['response'];
        if (isset($this->user) && isset($params['identities']) && !isset($this->name)) {
            $this->name = $params['identities']->create($this->user)->getValue('fullname');
        }
    }