public function getAction($name)
    {
        foreach ($this->actions as $action) {
            if ($action->name() === $name) {
                return $action;
            }
        }

        throw new \InvalidArgumentException(
            sprintf('Action "%s" not found for "%s" entity', $name, $this->name)
        );
    }
public function getAction($name)
    {
        foreach ($this->actions as $action) {
            if ($action->name() === $name) {
                return $action;
            }
        }

        throw new \InvalidArgumentException(
            sprintf('Action "%s" not found for "%s" entity', $name, $this->name)
        );
    }
public function getAction ( $ name ) { foreach ( $ this -> actions as $ action ) { if ( $ action -> name ( ) === $ name ) { return $ action ; } } throw new \ InvalidArgumentException ( sprintf ( 'Action "%s" not found for "%s" entity' , $ name , $ this -> name ) ) ; }
Gets the action of the name given.

@param string $name The action name

@throws \InvalidArgumentException when the given action not found in the entity

@return Action
Gets the action of the name given .