protected function executeSingleCustomCommand($commandClass, $entity)
    {
        $this->checkEntityType($entity);

        $instance = new $commandClass($this->aggregate($entity), $this->newQueryBuilder());

        return $instance->execute();
    }
protected function executeSingleCustomCommand($commandClass, $entity)
    {
        $this->checkEntityType($entity);

        $instance = new $commandClass($this->aggregate($entity), $this->newQueryBuilder());

        return $instance->execute();
    }
protected function executeSingleCustomCommand ( $ commandClass , $ entity ) { $ this -> checkEntityType ( $ entity ) ; $ instance = new $ commandClass ( $ this -> aggregate ( $ entity ) , $ this -> newQueryBuilder ( ) ) ; return $ instance -> execute ( ) ; }
Execute a single command instance.

@param string $commandClass
@param mixed  $entity

@throws \InvalidArgumentException
@throws MappingException

@return mixed
Execute a single command instance .