Example #1
0
 /**
  * @param null|Join $join
  * @return bool
  */
 public function equals($join)
 {
     $parametersOfThisClauses = array();
     $parametersOfJoinClauses = array();
     return null !== $join && $join instanceof Join && $this->getJoinType() === $join->getJoinType() && $this->getConditions() == $join->getConditions() && $this->getClause($parametersOfThisClauses) == $join->getClause($parametersOfJoinClauses);
 }
Example #2
0
 public function testConditionalJoin()
 {
     $j = new Join();
     $j->setJoinType(Criteria::LEFT_JOIN);
     $j->addExplicitCondition('log', 'AUTHOR_ID', null, 'author', 'ID', 'a', Join::EQUAL);
     $j->addLocalValueCondition('log', 'target_type', null, 'author', Join::EQUAL);
     $params = [];
     $this->assertEquals('LEFT JOIN author a ON (log.AUTHOR_ID=a.ID AND log.target_type=\'author\')', $j->getClause($params));
 }
 public function testAddExplicitconditionWithOneAlias()
 {
     $j = new Join();
     $j->setJoinType(Criteria::LEFT_JOIN);
     $j->addExplicitCondition('book', 'AUTHOR_ID', null, 'author', 'ID', 'a', Join::EQUAL);
     $params = array();
     $this->assertEquals($j->getClause($params), 'LEFT JOIN author a ON (book.AUTHOR_ID=a.ID)');
 }