public function execute($command, $context)
    {
        if (!$context instanceof  AnCommandContext) {
            $context = new AnCommandContext($context);
        }

        $parts = explode('.', $command);
        $method = '_'.$parts[0].'Entity'.ucfirst($parts[1]);
        $result = null;

        if (method_exists($this, $method)) {
            $result = $this->$method($context);
        }

        return $result;
    }
public function execute($command, $context)
    {
        if (!$context instanceof  AnCommandContext) {
            $context = new AnCommandContext($context);
        }

        $parts = explode('.', $command);
        $method = '_'.$parts[0].'Entity'.ucfirst($parts[1]);
        $result = null;

        if (method_exists($this, $method)) {
            $result = $this->$method($context);
        }

        return $result;
    }
public function execute ( $ command , $ context ) { if ( ! $ context instanceof AnCommandContext ) { $ context = new AnCommandContext ( $ context ) ; } $ parts = explode ( '.' , $ command ) ; $ method = '_' . $ parts [ 0 ] . 'Entity' . ucfirst ( $ parts [ 1 ] ) ; $ result = null ; if ( method_exists ( $ this , $ method ) ) { $ result = $ this -> $ method ( $ context ) ; } return $ result ; }
Executes a command on entity.

@param string                $command The command to execute. It must of form part1.part2
@param AnCommandContext|array $context The command context

@return bool
Executes a command on entity .