public static function create($values = [], $save = false)
    {
        $className = get_called_class();

        // create class
        $ActiveRecord = new $className();
        $ActiveRecord->setFields($values);

        if ($save) {
            $ActiveRecord->save();
        }

        return $ActiveRecord;
    }
public static function create($values = [], $save = false)
    {
        $className = get_called_class();

        // create class
        $ActiveRecord = new $className();
        $ActiveRecord->setFields($values);

        if ($save) {
            $ActiveRecord->save();
        }

        return $ActiveRecord;
    }
public static function create ( $ values = [ ] , $ save = false ) { $ className = get_called_class ( ) ; // create class $ ActiveRecord = new $ className ( ) ; $ ActiveRecord -> setFields ( $ values ) ; if ( $ save ) { $ ActiveRecord -> save ( ) ; } return $ ActiveRecord ; }
Create a new object from this model.

@param array $values Array of keys as fields and values.
@param boolean $save If the object should be immediately saved to database before being returned.
@return static An object of this model.
Create a new object from this model .