We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0433653 commit 42bc499Copy full SHA for 42bc499
test/misc/DAOTest.class.php
@@ -826,6 +826,30 @@ public function testIpRangeProperty()
826
$this->drop();
827
}
828
829
+ public function testLazy()
830
+ {
831
+ $this->create();
832
+
833
+ $parent = TestParentObject::create();
834
+ $child = TestChildObject::create()->setParent($parent);
835
836
+ $parent->dao()->add($parent);
837
838
+ $child->dao()->add($child);
839
840
+ $this->assertEquals(
841
+ $parent->getId(),
842
+ Criteria::create(TestChildObject::dao())->
843
+ setProjection(
844
+ Projection::property('parent.id', 'parentId')
845
+ )->
846
+ add(Expression::eq('id', $child->getId()))->
847
+ getCustom('parentId')
848
+ );
849
850
+ $this->drop();
851
+ }
852
853
protected function getSome()
854
{
855
for ($i = 1; $i < 3; ++$i) {
0 commit comments