protected function assignEntity($entity)
    {
        $entityClass = $this->model->entity();

        if ($entity === null) {
            throw new QueryException(sprintf('Missing required entity of class "%s"', $entityClass));
        }

        if (!is_array($entity) && !$entity instanceof $entityClass) {
            throw new QueryException(sprintf('Entity must be an instance of "%s" or array got "%s"', $entityClass, $this->getType($entity)));
        }

        $this->instance = $entity;
    }
protected function assignEntity($entity)
    {
        $entityClass = $this->model->entity();

        if ($entity === null) {
            throw new QueryException(sprintf('Missing required entity of class "%s"', $entityClass));
        }

        if (!is_array($entity) && !$entity instanceof $entityClass) {
            throw new QueryException(sprintf('Entity must be an instance of "%s" or array got "%s"', $entityClass, $this->getType($entity)));
        }

        $this->instance = $entity;
    }
protected function assignEntity ( $ entity ) { $ entityClass = $ this -> model -> entity ( ) ; if ( $ entity === null ) { throw new QueryException ( sprintf ( 'Missing required entity of class "%s"' , $ entityClass ) ) ; } if ( ! is_array ( $ entity ) && ! $ entity instanceof $ entityClass ) { throw new QueryException ( sprintf ( 'Entity must be an instance of "%s" or array got "%s"' , $ entityClass , $ this -> getType ( $ entity ) ) ) ; } $ this -> instance = $ entity ; }
Assigns entity instance
Asserts if entity instance is of expected type

@param array|object $entity

@throws QueryException
Assigns entity instance Asserts if entity instance is of expected type