/** * Initialize the object. * * @param \JDatabaseDriver $db */ public function __construct(\JDatabaseDriver $db = null) { parent::__construct($db); // Implement JObservableInterface: // Create observer updater and attaches all observers interested by $this class: $this->observers = new \JObserverUpdater($this); \JObserverMapper::attachAllObservers($this); }
/** * Set notification data to object parameters. * * <code> * $keys = array( * "group_id" => 1, * "points_id" => 2 * ); * * $data = array( * "title" => "......", * "description" => "......", * "activity_text" => "......", * "custom_data" => array(,,,), * "params" => array(,,,), * "image" => "picture.png", * "note" => null, * "published" => 1, * "group_id" => 3, * "points_number" => 100, * "points_title" => 100, * "points_id" => 1 * ); * * $badge = new Gamification\Badge\Badge(\JFactory::getDbo()); * $badge->load($keys); * * $badge->bind($data); * </code> * * @param array $data * @param array $ignored */ public function bind($data, array $ignored = array()) { // Parse custom data of the object if they exists. if (array_key_exists('custom_data', $data) and !in_array('custom_data', $ignored, true)) { $this->custom_data = new Registry($data['custom_data']); unset($data['custom_data']); } parent::bind($data, $ignored); }
/** * Initialize the object. * * @param \JDatabaseDriver $db */ public function __construct(\JDatabaseDriver $db = null) { parent::__construct($db); $this->gateway_data = new Registry(); }
/** * Initialize the object. * * @param \JDatabaseDriver $db */ public function __construct(\JDatabaseDriver $db = null) { parent::__construct($db); $this->custom_data = new Registry(); $this->rewards = new Registry(); }
/** * Reset the properties of the object. * * <code> * $notificationId = 1; * * $notification = new Socialcommunity\Notification\Notification(\JFactory::getDbo()); * $notification->load($notificationId); * * if (...) { * $notification->reset(); * } * </code> */ public function reset() { parent::reset(); $this->status = 0; }
/** * Initialize the object. * * @param \JDatabaseDriver $db */ public function __construct(\JDatabaseDriver $db = null) { parent::__construct($db); $this->allowedStatuses = array('pending', 'completed', 'canceled', 'refunded', 'failed'); }