Source for file behavior.php

Documentation is available at behavior.php

  1. <?php
  2. /**
  3.  * @package     FrameworkOnFramework
  4.  * @subpackage  model
  5.  * @copyright   Copyright (C) 2010 - 2012 Akeeba Ltd. All rights reserved.
  6.  * @license     GNU General Public License version 2 or later; see LICENSE.txt
  7.  */
  8. // Protect from unauthorized access
  9. defined('_JEXEC'or die;
  10.  
  11. /**
  12.  * FrameworkOnFramework model behavior class. It defines the events which are
  13.  * called by a Model.
  14.  *
  15.  * @package  FrameworkOnFramework
  16.  * @since    2.1
  17.  */
  18. abstract class FOFModelBehavior extends JEvent
  19. {
  20.     /**
  21.      * This event runs before saving data in the model
  22.      *
  23.      * @param   FOFModel  &$model  The model which calls this event
  24.      * @param   array     &$data   The data to save
  25.      *
  26.      * @return  void 
  27.      */
  28.     public function onBeforeSave(&$model&$data)
  29.     {
  30.     }
  31.  
  32.     /**
  33.      * This event runs before deleting a record in a model
  34.      *
  35.      * @param   FOFModel  &$model  The model which calls this event
  36.      *
  37.      * @return  void 
  38.      */
  39.     public function onBeforeDelete(&$model)
  40.     {
  41.     }
  42.  
  43.     /**
  44.      * This event runs before copying a record in a model
  45.      *
  46.      * @param   FOFModel  &$model  The model which calls this event
  47.      *
  48.      * @return  void 
  49.      */
  50.     public function onBeforeCopy(&$model)
  51.     {
  52.     }
  53.  
  54.     /**
  55.      * This event runs before publishing a record in a model
  56.      *
  57.      * @param   FOFModel  &$model  The model which calls this event
  58.      *
  59.      * @return  void 
  60.      */
  61.     public function onBeforePublish(&$model)
  62.     {
  63.     }
  64.  
  65.     /**
  66.      * This event runs before registering a hit on a record in a model
  67.      *
  68.      * @param   FOFModel  &$model  The model which calls this event
  69.      *
  70.      * @return  void 
  71.      */
  72.     public function onBeforeHit(&$model)
  73.     {
  74.     }
  75.  
  76.     /**
  77.      * This event runs before moving a record in a model
  78.      *
  79.      * @param   FOFModel  &$model  The model which calls this event
  80.      *
  81.      * @return  void 
  82.      */
  83.     public function onBeforeMove(&$model)
  84.     {
  85.     }
  86.  
  87.     /**
  88.      * This event runs before changing the records' order in a model
  89.      *
  90.      * @param   FOFModel  &$model  The model which calls this event
  91.      *
  92.      * @return  void 
  93.      */
  94.     public function onBeforeReorder(&$model)
  95.     {
  96.     }
  97.  
  98.     /**
  99.      * This event runs when we are building the query used to fetch a record
  100.      * list in a model
  101.      *
  102.      * @param   FOFModel        &$model  The model which calls this event
  103.      * @param   JDatabaseQuery  &$query  The model which calls this event
  104.      *
  105.      * @return  void 
  106.      */
  107.     public function onBeforeBuildQuery(&$model&$query)
  108.     {
  109.     }
  110.  
  111.     /**
  112.      * This event runs after saving a record in a model
  113.      *
  114.      * @param   FOFModel  &$model  The model which calls this event
  115.      *
  116.      * @return  void 
  117.      */
  118.     public function onAfterSave(&$model)
  119.     {
  120.     }
  121.  
  122.     /**
  123.      * This event runs after deleting a record in a model
  124.      *
  125.      * @param   FOFModel  &$model  The model which calls this event
  126.      *
  127.      * @return  void 
  128.      */
  129.     public function onAfterDelete(&$model)
  130.     {
  131.     }
  132.  
  133.     /**
  134.      * This event runs after copying a record in a model
  135.      *
  136.      * @param   FOFModel  &$model  The model which calls this event
  137.      *
  138.      * @return  void 
  139.      */
  140.     public function onAfterCopy(&$model)
  141.     {
  142.     }
  143.  
  144.     /**
  145.      * This event runs after publishing a record in a model
  146.      *
  147.      * @param   FOFModel  &$model  The model which calls this event
  148.      *
  149.      * @return  void 
  150.      */
  151.     public function onAfterPublish(&$model)
  152.     {
  153.     }
  154.  
  155.     /**
  156.      * This event runs after registering a hit on a record in a model
  157.      *
  158.      * @param   FOFModel  &$model  The model which calls this event
  159.      *
  160.      * @return  void 
  161.      */
  162.     public function onAfterHit(&$model)
  163.     {
  164.     }
  165.  
  166.     /**
  167.      * This event runs after moving a record in a model
  168.      *
  169.      * @param   FOFModel  &$model  The model which calls this event
  170.      *
  171.      * @return  void 
  172.      */
  173.     public function onAfterMove(&$model)
  174.     {
  175.     }
  176.  
  177.     /**
  178.      * This event runs after reordering records in a model
  179.      *
  180.      * @param   FOFModel  &$model  The model which calls this event
  181.      *
  182.      * @return  void 
  183.      */
  184.     public function onAfterReorder(&$model)
  185.     {
  186.     }
  187.  
  188.     /**
  189.      * This event runs after we have built the query used to fetch a record
  190.      * list in a model
  191.      *
  192.      * @param   FOFModel        &$model  The model which calls this event
  193.      * @param   JDatabaseQuery  &$query  The model which calls this event
  194.      *
  195.      * @return  void 
  196.      */
  197.     public function onAfterBuildQuery(&$model&$query)
  198.     {
  199.     }
  200.  
  201.     /**
  202.      * This event runs after getting a single item
  203.      *
  204.      * @param   FOFModel  &$model   The model which calls this event
  205.      * @param   FOFTable  &$record  The record loaded by this model
  206.      *
  207.      * @return  void 
  208.      */
  209.     public function onAfterGetItem(&$model&$record)
  210.     {
  211.     }
  212. }

Documentation generated on Tue, 19 Nov 2013 14:54:30 +0100 by phpDocumentor 1.4.3