Back to Rules class

Method __toString

public string
__toString
()
Magic method to convert the object to JSON string representation.
Returns
  • string JSON representation of the actions array
Since
  • 1.7.0
Class: Rules
Project: Joomla

Method __toString - Source code

/**
 * Magic method to convert the object to JSON string representation.
 *
 * @return  string  JSON representation of the actions array
 *
 * @since   1.7.0
 */
public function __toString()
{
    $temp = array();
    foreach ($this->data as $name => $rule) {
        if ($data = $rule->getData()) {
            $temp[$name] = $data;
        }
    }
    return json_encode($temp, JSON_FORCE_OBJECT);
}