示例#1
0
 public function testJoinChildrenWhere()
 {
     $finder = Finder::comment(Finder::post()->author[122])->author[122]->company(array('name' => 'Google'));
     $schema = new Schemas\Infered();
     $query = $schema->generateQuery($finder);
     $this->assertEquals('SELECT comment.*, post.*, author.*, author2.*, company.* FROM comment LEFT JOIN post ON comment.post_id = post.id INNER JOIN author ON post.author_id = author.id INNER JOIN author AS author2 ON comment.author_id = author2.id INNER JOIN company ON author2.company_id = company.id WHERE author.id=:AuthorId AND author2.id=:Author2Id AND company.name=:CompanyName', (string) $query);
 }