public function entity(array $data = [])
    {
        // @todo あとでroomオブジェクトの生成方法とかを見直す
        $roomFactory = new RoomFactory();
        $userFactory = new UserFactory();

        $task = new Task();
        foreach ($data as $key => $value) {
            $property = Inflector::variable($key);
            if ('room' == $property) {
                $task->$property = $roomFactory->entity($value);
            } elseif ('assignedByAccount' == $property || 'account' == $property) {
                $task->$property = $userFactory->entity($value);
            } else {
                $task->$property = $value;
            }
        }

        return $task;
    }
public function entity(array $data = [])
    {
        // @todo あとでroomオブジェクトの生成方法とかを見直す
        $roomFactory = new RoomFactory();
        $userFactory = new UserFactory();

        $task = new Task();
        foreach ($data as $key => $value) {
            $property = Inflector::variable($key);
            if ('room' == $property) {
                $task->$property = $roomFactory->entity($value);
            } elseif ('assignedByAccount' == $property || 'account' == $property) {
                $task->$property = $userFactory->entity($value);
            } else {
                $task->$property = $value;
            }
        }

        return $task;
    }
@param array $data

@return Task