src/Entity/Factory/MemberFactory.php
public function entity(array $data = [])
    {
        $member = new Member();
        $member->role = $data['role'];
        unset($data['role']);

        // @todo ここでFactoryオブジェクトを生成するのをなんとかしたい...
        $userFactory = new UserFactory();
        $member->account = $userFactory->entity($data);

        return $member;
    }
public function entity(array $data = [])
    {
        $member = new Member();
        $member->role = $data['role'];
        unset($data['role']);

        // @todo ここでFactoryオブジェクトを生成するのをなんとかしたい...
        $userFactory = new UserFactory();
        $member->account = $userFactory->entity($data);

        return $member;
    }
public function entity ( array $ data = [ ] ) { $ member = new Member ( ) ; $ member -> role = $ data [ 'role' ] ; unset ( $ data [ 'role' ] ) ; // @todo ここでFactoryオブジェクトを生成するのをなんとかしたい... $ userFactory = new UserFactory ( ) ; $ member -> account = $ userFactory -> entity ( $ data ) ; return $ member ; }
@param array $data

@return Member
@param array $data