public function getOperation($name)
    {
        if (!$this->hasOperation($name)) {
            throw new \InvalidArgumentException("No operation found named $name");
        }

        // Lazily create operations as they are retrieved
        if (!($this->operations[$name] instanceof Operation)) {
            $this->operations[$name]['name'] = $name;
            $this->operations[$name] = new Operation($this->operations[$name], $this);
        }

        return $this->operations[$name];
    }
public function getOperation($name)
    {
        if (!$this->hasOperation($name)) {
            throw new \InvalidArgumentException("No operation found named $name");
        }

        // Lazily create operations as they are retrieved
        if (!($this->operations[$name] instanceof Operation)) {
            $this->operations[$name]['name'] = $name;
            $this->operations[$name] = new Operation($this->operations[$name], $this);
        }

        return $this->operations[$name];
    }
public function getOperation ( $ name ) { if ( ! $ this -> hasOperation ( $ name ) ) { throw new \ InvalidArgumentException ( "No operation found named $name" ) ; } // Lazily create operations as they are retrieved if ( ! ( $ this -> operations [ $ name ] instanceof Operation ) ) { $ this -> operations [ $ name ] [ 'name' ] = $ name ; $ this -> operations [ $ name ] = new Operation ( $ this -> operations [ $ name ] , $ this ) ; } return $ this -> operations [ $ name ] ; }
Get an API operation by name

@param string $name Name of the command

@return Operation
@throws \InvalidArgumentException if the operation is not found
Get an API operation by name