diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-10-25 16:22:10 -0700 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-10-25 16:22:10 -0700 |
commit | 9e2b2a32fd0e967ad3184e9a5d091a29953acb91 (patch) | |
tree | 00822e24aa1110c73ca455a8d096ef296c008cbc /vendor/fguillot/picodb/lib/PicoDb/Builder/BaseBuilder.php | |
parent | c507c5416251c505cb3e088a03c6664bed73c812 (diff) |
Include composer dependencies in repo
Diffstat (limited to 'vendor/fguillot/picodb/lib/PicoDb/Builder/BaseBuilder.php')
-rw-r--r-- | vendor/fguillot/picodb/lib/PicoDb/Builder/BaseBuilder.php | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/vendor/fguillot/picodb/lib/PicoDb/Builder/BaseBuilder.php b/vendor/fguillot/picodb/lib/PicoDb/Builder/BaseBuilder.php new file mode 100644 index 00000000..e075ae3c --- /dev/null +++ b/vendor/fguillot/picodb/lib/PicoDb/Builder/BaseBuilder.php @@ -0,0 +1,86 @@ +<?php + +namespace PicoDb\Builder; + +use PicoDb\Database; + +/** + * Class InsertBuilder + * + * @package PicoDb\Builder + * @author Frederic Guillot + */ +abstract class BaseBuilder +{ + /** + * @var Database + */ + protected $db; + + /** + * @var ConditionBuilder + */ + protected $conditionBuilder; + + /** + * @var string + */ + protected $table = ''; + + /** + * @var string[] + */ + protected $columns = array(); + + /** + * InsertBuilder constructor + * + * @param Database $db + * @param ConditionBuilder $condition + */ + public function __construct(Database $db, ConditionBuilder $condition) + { + $this->db = $db; + $this->conditionBuilder = $condition; + } + + /** + * Get object instance + * + * @static + * @access public + * @param Database $db + * @param ConditionBuilder $condition + * @return static + */ + public static function getInstance(Database $db, ConditionBuilder $condition) + { + return new static($db, $condition); + } + + /** + * Set table name + * + * @access public + * @param string $table + * @return $this + */ + public function withTable($table) + { + $this->table = $table; + return $this; + } + + /** + * Set columns name + * + * @access public + * @param string[] $columns + * @return $this + */ + public function withColumns(array $columns) + { + $this->columns = $columns; + return $this; + } +} |