コード例 #1
0
ファイル: AfterStoreEvent.php プロジェクト: Rai-Ka/joomla-cms
 /**
  * Constructor.
  *
  * Mandatory arguments:
  * subject		JTableInterface	The table we are operating on
  * result		boolean         Did the save succeed?
  *
  * @param   string  $name       The event name.
  * @param   array   $arguments  The event arguments.
  *
  * @throws  BadMethodCallException
  */
 public function __construct($name, array $arguments = array())
 {
     if (!array_key_exists('result', $arguments)) {
         throw new BadMethodCallException("Argument 'result' is required for event {$name}");
     }
     parent::__construct($name, $arguments);
 }
コード例 #2
0
ファイル: BeforeMoveEvent.php プロジェクト: Rai-Ka/joomla-cms
 /**
  * Constructor.
  *
  * Mandatory arguments:
  * subject		JTableInterface	The table we are operating on
  * query		JDatabaseQuery	The query to get the primary keys and ordering values for the selection.
  * delta		int				The direction and magnitude to move the row in the ordering sequence.
  * where		string			WHERE clause to use for limiting the selection of rows to compact the ordering values.
  *
  * @param   string  $name       The event name.
  * @param   array   $arguments  The event arguments.
  *
  * @throws  BadMethodCallException
  */
 public function __construct($name, array $arguments = array())
 {
     if (!array_key_exists('query', $arguments)) {
         throw new BadMethodCallException("Argument 'query' is required for event {$name}");
     }
     if (!array_key_exists('delta', $arguments)) {
         throw new BadMethodCallException("Argument 'delta' is required for event {$name}");
     }
     if (!array_key_exists('where', $arguments)) {
         throw new BadMethodCallException("Argument 'where' is required for event {$name}");
     }
     parent::__construct($name, $arguments);
 }
コード例 #3
0
 /**
  * Constructor.
  *
  * Mandatory arguments:
  * subject		JTableInterface	The table we are operating on
  * pks			mixed			An optional array of primary key values to update.
  * state		int				The publishing state. eg. [0 = unpublished, 1 = published]
  * userId		int				The user id of the user performing the operation.
  *
  * @param   string  $name       The event name.
  * @param   array   $arguments  The event arguments.
  *
  * @throws  BadMethodCallException
  */
 public function __construct($name, array $arguments = array())
 {
     if (!array_key_exists('pks', $arguments)) {
         throw new BadMethodCallException("Argument 'pks' is required for event {$name}");
     }
     if (!array_key_exists('state', $arguments)) {
         throw new BadMethodCallException("Argument 'state' is required for event {$name}");
     }
     if (!array_key_exists('userId', $arguments)) {
         throw new BadMethodCallException("Argument 'userId' is required for event {$name}");
     }
     parent::__construct($name, $arguments);
 }