File tree Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Original file line number Diff line number Diff line change
1
+ 2011-11-21 Alexey S. Denisov, Evgeny V. Kokovikhin
2
+
3
+ * meta/types/ObjectType.class.php, test/misc/DAOTest.class.php: changed logic
4
+ for getObjectId method of lazy encapsulant; test for lazy logic added
5
+
1
6
2011-11-29 Igor V. Gulyaev
2
7
3
8
* test/main/ViewTest.class.php: added View test
Original file line number Diff line number Diff line change @@ -121,7 +121,9 @@ public function {$methodName}()
121
121
122
122
public function {$ methodName }Id()
123
123
{
124
- return \$this-> {$ name }Id;
124
+ return \$this-> {$ name }
125
+ ? \$this-> {$ name }->getId()
126
+ : \$this-> {$ name }Id;
125
127
}
126
128
127
129
EOT ;
Original file line number Diff line number Diff line change @@ -826,6 +826,30 @@ public function testIpRangeProperty()
826
826
$ this ->drop ();
827
827
}
828
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
+
829
853
protected function getSome ()
830
854
{
831
855
for ($ i = 1 ; $ i < 3 ; ++$ i ) {
You can’t perform that action at this time.
0 commit comments