protected function _instantiateUser($data)
    {
        if (get_viewer()->guest()) {

            $data->append(array(
                'person' => new AnConfig(),
            ));

            $person_data = array(
                'givenName' => $data->person->givenName,
                'familyName' => $data->person->familyName,
                'email' => $data->person->email,
                'username' => $data->person->username,
                'password' => $data->person->password,
                'usertype' => ComPeopleDomainEntityPerson::USERTYPE_REGISTERED
            );

            $person = $this->getService('repos:people.person')
                           ->getEntity()
                           ->reset()
                           ->setData($person_data);
        } else {
            $person = get_viewer();
        }

        $this->order->setSubscriber($person);
        $this->person = $person;

        return $person;
    }
protected function _instantiateUser($data)
    {
        if (get_viewer()->guest()) {

            $data->append(array(
                'person' => new AnConfig(),
            ));

            $person_data = array(
                'givenName' => $data->person->givenName,
                'familyName' => $data->person->familyName,
                'email' => $data->person->email,
                'username' => $data->person->username,
                'password' => $data->person->password,
                'usertype' => ComPeopleDomainEntityPerson::USERTYPE_REGISTERED
            );

            $person = $this->getService('repos:people.person')
                           ->getEntity()
                           ->reset()
                           ->setData($person_data);
        } else {
            $person = get_viewer();
        }

        $this->order->setSubscriber($person);
        $this->person = $person;

        return $person;
    }
protected function _instantiateUser ( $ data ) { if ( get_viewer ( ) -> guest ( ) ) { $ data -> append ( array ( 'person' => new AnConfig ( ) , ) ) ; $ person_data = array ( 'givenName' => $ data -> person -> givenName , 'familyName' => $ data -> person -> familyName , 'email' => $ data -> person -> email , 'username' => $ data -> person -> username , 'password' => $ data -> person -> password , 'usertype' => ComPeopleDomainEntityPerson :: USERTYPE_REGISTERED ) ; $ person = $ this -> getService ( 'repos:people.person' ) -> getEntity ( ) -> reset ( ) -> setData ( $ person_data ) ; } else { $ person = get_viewer ( ) ; } $ this -> order -> setSubscriber ( $ person ) ; $ this -> person = $ person ; return $ person ; }
Instantiate a ComPeopleDomainEntityPerson object

@param AnConfig $data

@return ComPeopleDomainEntityPerson instance
Instantiate a ComPeopleDomainEntityPerson object