Let the platform do the work

after_fetch_query

Overview

The after_fetch_query logic hook executes after a sugar query has been executed.

Definition

  function after_fetch_query($bean, $event, $arguments){}

Arguments

Name Type Description
bean Object The bean object
event String The current event
arguments Array Additional information related to the event
arguments.beans Array An array of bean objects resulting from the query
arguments.fields Array An array of selected fields
arguments.rows Array An array representation of the selected beans

Change Log

Version Note
7.7.0.0 Added after_fetch_query logic hook

Examples

Creating a Logic Hook using Extension Framework

./custom/Extension/modules/<module>/Ext/LogicHooks/<file>.php

  <?php

    $hook_array['after_fetch_query'][] = Array(
        //Processing index. For sorting the array.
        1,

        //Label. A string value to identify the hook.
        'after_fetch_query example',

        //The PHP file where your class is located.
        'custom/modules/<module>/after_fetch_query_class.php',

        //The class the method is in.
        'after_fetch_query_class',

        //The method to call.
        'after_fetch_query_method'
    );

?>

./custom/modules/<module>/after_fetch_query_class.php

  <?php

    class after_fetch_query_class
    {
        function after_fetch_query_method($bean, $event, $arguments)
        {
            //logic
        }
    }

?>

Topics