コード例 #1
0
ファイル: Chunker.php プロジェクト: tristanpemble/lhm_php
 /**
  * @param AdapterInterface $adapter
  * @param \Phinx\Db\Table $origin
  * @param \Lhm\Table $destination
  * @param SqlHelper $sqlHelper
  * @param array $options
  *                      - `stride`
  *                          Size of chunk ( defaults to 2000 )
  */
 public function __construct(AdapterInterface $adapter, \Phinx\Db\Table $origin, \Lhm\Table $destination, SqlHelper $sqlHelper = null, array $options = [])
 {
     $this->adapter = $adapter;
     $this->origin = $origin;
     $this->destination = $destination;
     $this->sqlHelper = $sqlHelper ?: new SqlHelper($this->adapter);
     $this->options = $options + ['stride' => 2000];
     $this->primaryKey = $this->adapter->quoteColumnName($this->sqlHelper->extractPrimaryKey($this->origin));
     $this->nextToInsert = $this->start = $this->selectStart();
     $this->limit = $this->selectLimit();
     $this->intersection = new Intersection($this->origin, $this->destination);
 }
コード例 #2
0
ファイル: SqlHelper.php プロジェクト: tristanpemble/lhm_php
 /**
  * @param array $columns List of column names
  * @return array
  */
 public function quoteColumns(array $columns)
 {
     $quoted = [];
     foreach ($columns as $column) {
         $quoted[] = $this->adapter->quoteColumnName($column);
     }
     return $quoted;
 }
コード例 #3
0
ファイル: CakeAdapter.php プロジェクト: lhas/pep
 /**
  * Quotes a column name for use in a query.
  *
  * @param string $columnName Table Name
  * @return string
  */
 public function quoteColumnName($columnName)
 {
     return $this->adapter->quoteColumnName($columnName);
 }