/** * Method to bind the data. * * @param array $array The data to bind. * @param mixed $ignore An array or space separated list of fields to ignore. * * @return boolean True on success, false on failure. * * @since 11.1 */ public function bind($array, $ignore = '') { // Bind the rules as appropriate. if (isset($array['rules'])) { if (is_array($array['rules'])) { $array['rules'] = json_encode($array['rules']); } } return parent::bind($array, $ignore); }
/** * Overloaded bind function * * @param array $array Named array * @param mixed $ignore An optional array or space separated list of properties * to ignore while binding. * * @return mixed Null if operation was satisfactory, otherwise returns an error * * @see JTable::bind * @since 11.1 */ public function bind($array, $ignore = '') { if (isset($array['params']) && is_array($array['params'])) { $registry = new Registry(); $registry->loadArray($array['params']); $array['params'] = (string) $registry; } if (isset($array['control']) && is_array($array['control'])) { $registry = new Registry(); $registry->loadArray($array['control']); $array['control'] = (string) $registry; } return parent::bind($array, $ignore); }
/** * Method to bind the user, user groups, and any other necessary data. * * @param array $array The data to bind. * @param mixed $ignore An array or space separated list of fields to ignore. * * @return boolean True on success, false on failure. * * @since 11.1 */ public function bind($array, $ignore = '') { if (array_key_exists('params', $array) && is_array($array['params'])) { $registry = new Registry(); $registry->loadArray($array['params']); $array['params'] = (string) $registry; } // Attempt to bind the data. $return = parent::bind($array, $ignore); // Load the real group data based on the bound ids. if ($return && !empty($this->groups)) { // Set the group ids. ArrayHelper::toInteger($this->groups); // Get the titles for the user groups. $query = $this->_db->getQuery(true); $query->select($this->_db->quoteName('id')); $query->select($this->_db->quoteName('title')); $query->from($this->_db->quoteName('#__usergroups')); $query->where($this->_db->quoteName('id') . ' = ' . implode(' OR ' . $this->_db->quoteName('id') . ' = ', $this->groups)); $this->_db->setQuery($query); // Set the titles for the user groups. $this->groups = $this->_db->loadAssocList('id', 'id'); } return $return; }