コード例 #1
0
ファイル: Join.php プロジェクト: alcyz/alcys-orm
 /**
  * Check the passed arguments and throw an exception if necessary.
  *
  * @param ColumnInterface $firstColumn
  * @param ColumnInterface $secondColumn
  *
  * @throws \Exception
  */
 private function _validateOnArguments(ColumnInterface $firstColumn, ColumnInterface $secondColumn)
 {
     $initialJoinArray = array('way' => null, 'tables' => null, 'conditionType' => null, 'condition' => null);
     if ($this->joinArray === $initialJoinArray) {
         throw new \Exception('method to set join way have call before!');
     }
     if (!$firstColumn->getTableName() || !$secondColumn->getTableName()) {
         throw new \Exception('column arguments require a referenced table!');
     }
     //		if($firstColumn->getColumnName() !== $secondColumn->getColumnName())
     //		{
     //			throw new \Exception('column arguments require a equivalent column names!');
     //		}
 }
コード例 #2
0
ファイル: Condition.php プロジェクト: alcyz/alcys-orm
 /**
  * Add a not null condition to the condition array.
  * The order of the method call is important, in which way the condition string will
  * concatenate.
  *
  * @param ColumnInterface $column Name of the column to compare.
  *
  * @return $this The same instance to concatenate methods.
  */
 public function notNull(ColumnInterface $column)
 {
     $columnName = $column->getAlias() ?: $column->getColumnName();
     $condition = $columnName . ' IS NOT NULL';
     $this->_addCondition($condition);
     return $this;
 }