DB\SQL\Mapper::__construct PHP Метод

__construct() публичный Метод

Instantiate class
public __construct ( SQL $db, $table, $fields = NULL, $ttl = 60 )
$db DB\SQL object
$table string
$fields array|string
$ttl int|array
    function __construct(\DB\SQL $db, $table, $fields = NULL, $ttl = 60)
    {
        $this->db = $db;
        $this->engine = $db->driver();
        if ($this->engine == 'oci') {
            $table = strtoupper($table);
        }
        $this->source = $table;
        $this->table = $this->db->quotekey($table);
        $this->fields = $db->schema($table, $fields, $ttl);
        $this->reset();
    }

Usage Example

Пример #1
0
 public function __construct($id = null)
 {
     parent::__construct(\Base::instance()->get('DB'), 'connections');
     if ($id) {
         $this->load('id = ' . $id);
     }
 }
All Usage Examples Of DB\SQL\Mapper::__construct