public function executeCustomCommand($command, $entity)
    {
        $commandClass = $this->customCommands[$command];

        if ($this->manager->isTraversable($entity)) {
            foreach ($entity as $instance) {
                $this->executeSingleCustomCommand($commandClass, $instance);
            }
        } else {
            return $this->executeSingleCustomCommand($commandClass, $entity);
        }
    }
public function executeCustomCommand($command, $entity)
    {
        $commandClass = $this->customCommands[$command];

        if ($this->manager->isTraversable($entity)) {
            foreach ($entity as $instance) {
                $this->executeSingleCustomCommand($commandClass, $instance);
            }
        } else {
            return $this->executeSingleCustomCommand($commandClass, $entity);
        }
    }
public function executeCustomCommand ( $ command , $ entity ) { $ commandClass = $ this -> customCommands [ $ command ] ; if ( $ this -> manager -> isTraversable ( $ entity ) ) { foreach ( $ entity as $ instance ) { $ this -> executeSingleCustomCommand ( $ commandClass , $ instance ) ; } } else { return $ this -> executeSingleCustomCommand ( $ commandClass , $ entity ) ; } }
Execute a custom command on an Entity.

@param string                 $command
@param mixed|Collection|array $entity

@throws \InvalidArgumentException
@throws MappingException

@return mixed
Execute a custom command on an Entity .