public function findActionByName($action)
    {
        $actions = $this->owner->getBetterButtonsActions();
        $formAction = false;

        foreach ($actions as $f) {
            if ($formAction) {
                break;
            }

            if ($f instanceof CompositeField) {
                $formAction = $f->fieldByName($action);
            } elseif ($f->getName() === $action) {
                $formAction = $f;
            }
        }

        if (!$formAction) {
            $utils = $this->owner->getBetterButtonsUtils();
            $formAction = $utils->fieldByName($action);
        }

        return $formAction;
    }
public function findActionByName($action)
    {
        $actions = $this->owner->getBetterButtonsActions();
        $formAction = false;

        foreach ($actions as $f) {
            if ($formAction) {
                break;
            }

            if ($f instanceof CompositeField) {
                $formAction = $f->fieldByName($action);
            } elseif ($f->getName() === $action) {
                $formAction = $f;
            }
        }

        if (!$formAction) {
            $utils = $this->owner->getBetterButtonsUtils();
            $formAction = $utils->fieldByName($action);
        }

        return $formAction;
    }
public function findActionByName ( $ action ) { $ actions = $ this -> owner -> getBetterButtonsActions ( ) ; $ formAction = false ; foreach ( $ actions as $ f ) { if ( $ formAction ) { break ; } if ( $ f instanceof CompositeField ) { $ formAction = $ f -> fieldByName ( $ action ) ; } elseif ( $ f -> getName ( ) === $ action ) { $ formAction = $ f ; } } if ( ! $ formAction ) { $ utils = $ this -> owner -> getBetterButtonsUtils ( ) ; $ formAction = $ utils -> fieldByName ( $ action ) ; } return $ formAction ; }
Gets a FormAction or BetterButtonCustomAction by name, in utils or actions
@param  string $action  The name of the action to find
@return FormAction
Gets a FormAction or BetterButtonCustomAction by name in utils or actions