Back to Content class

Method bind

public mixed
bind
(mixed $array, mixed $ignore = '')
Overloaded bind function
Parameters
  • array $array Named array
  • mixed $ignore An optional array or space separated list of properties to ignore while binding.
Returns
  • mixed Null if operation was satisfactory, otherwise returns an error string
Since
  • 1.6
-
  • \Joomla\CMS\Table\Table::bind()
Class: Content
Project: Joomla

Method bind - Source code

/**
 * 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 string
 *
 * @see     Table::bind()
 * @since   1.6
 */
public function bind($array, $ignore = '')
{
    // Search for the {readmore} tag and split the text up accordingly.
    if (isset($array['articletext'])) {
        $pattern = '#<hr\\s+id=("|\')system-readmore("|\')\\s*\\/*>#i';
        $tagPos = preg_match($pattern, $array['articletext']);
        if ($tagPos == 0) {
            $this->introtext = $array['articletext'];
            $this->fulltext = '';
        } else {
            list($this->introtext, $this->fulltext) = preg_split($pattern, $array['articletext'], 2);
        }
    }
    if (isset($array['attribs']) && \is_array($array['attribs'])) {
        $registry = new Registry($array['attribs']);
        $array['attribs'] = (string) $registry;
    }
    if (isset($array['metadata']) && \is_array($array['metadata'])) {
        $registry = new Registry($array['metadata']);
        $array['metadata'] = (string) $registry;
    }
    // Bind the rules.
    if (isset($array['rules']) && \is_array($array['rules'])) {
        $rules = new Rules($array['rules']);
        $this->setRules($rules);
    }
    return parent::bind($array, $ignore);
}