Granada\Granada::set PHP Method

set() public method

Setter method, allows $model->set('property', 'value') access to data.
public set ( $property, string | null $value = null )
$value string | null
    public function set($property, $value = null)
    {
        if (!is_array($property)) {
            $property = array($property => $value);
        }
        foreach ($property as $field => $val) {
            if (method_exists($this, $method = 'set_' . $field)) {
                $property[$field] = $this->{$method}($val);
                $value = null;
            } elseif (method_exists($this, $field)) {
                $this->relationships[$field] = $val;
            }
        }
        $result = $this->orm->set($property, $value);
        return $result;
    }