@@ -27,22 +27,29 @@ public function getUncacheObjectTags(IdentifiableObject $object, $className)
27
27
$ tags = array_merge ($ this ->getDefaultTags ($ className ), $ tags );
28
28
29
29
foreach ($ this ->getLinkProperties ($ className ) as $ name => $ property ) {
30
+ /* @var $property LightMetaProperty */
30
31
if ($ name == 'id ' ) {
31
32
continue ;
32
33
}
33
34
if ($ property ->getClassName ()) {
34
- if ($ property ->getFetchStrategyId () == FetchStrategy::LAZY ) {
35
- if ($ linkedObjectId = $ object ->{$ property ->getGetter ().'Id ' }()) {
36
- $ tags [] = $ this ->getTagByClassAndId ($ property ->getClassName (), $ linkedObjectId );
37
- }
38
- } elseif ($ property ->getFetchStrategyId ()) {
39
- if (
40
- ($ linkedObject = $ object ->{$ property ->getGetter ()}())
41
- && $ linkedObject instanceof IdentifiableObject
42
- && $ linkedObjectId = $ linkedObject ->getId ()
43
- ) {
44
- $ tags [] = $ this ->getTagByClassAndId ($ property ->getClassName (), $ linkedObjectId );
35
+ if ($ property ->getRelationId () == MetaRelation::ONE_TO_ONE ) {
36
+ if ($ property ->getFetchStrategyId () == FetchStrategy::LAZY ) {
37
+ if ($ linkedObjectId = $ object ->{$ property ->getGetter ().'Id ' }()) {
38
+ $ tags [] = $ this ->getTagByClassAndId ($ property ->getClassName (), $ linkedObjectId );
39
+ }
40
+ } elseif ($ property ->getFetchStrategyId ()) {
41
+ if (
42
+ ($ linkedObject = $ object ->{$ property ->getGetter ()}())
43
+ && $ linkedObject instanceof IdentifiableObject
44
+ && $ linkedObjectId = $ linkedObject ->getId ()
45
+ ) {
46
+ $ tags [] = $ this ->getTagByClassAndId ($ property ->getClassName (), $ linkedObjectId );
47
+ }
45
48
}
49
+ } elseif ($ property ->getRelationId () == MetaRelation::MANY_TO_MANY ) {
50
+ $ daoHelper = $ object ->{$ property ->getGetter ()}();
51
+ /* @var $daoHelper ManyToManyLinked */
52
+ $ tags [] = $ daoHelper ->getHelperTable ();
46
53
}
47
54
}
48
55
}
@@ -83,7 +90,6 @@ public function getQueryTags(SelectQuery $query, $className)
83
90
}
84
91
}
85
92
86
-
87
93
return $ tagList ;
88
94
}
89
95
@@ -166,7 +172,9 @@ protected function getLinkObjectColumnListByClass($className)
166
172
$ columnList = array ();
167
173
foreach ($ this ->getLinkProperties ($ className ) as $ property ) {
168
174
/* @var $property LightMetaProperty */
169
- $ columnList [$ property ->getColumnName ()] = $ property ->getClassName ();
175
+ if ($ property ->getRelationId () == MetaRelation::ONE_TO_ONE || $ property ->getName () == 'id ' ) {
176
+ $ columnList [$ property ->getColumnName ()] = $ property ->getClassName ();
177
+ }
170
178
}
171
179
$ result [$ className ] = $ columnList ;
172
180
}
@@ -206,10 +214,12 @@ protected function getLinkProperties($className) {
206
214
);
207
215
} elseif ($ property instanceof LightMetaProperty) {
208
216
switch ($ property ->getType ()) {
209
- case 'identifierList ' :
210
217
case 'identifier ' :
218
+ case 'identifierList ' :
211
219
case 'integerIdentifier ' :
220
+ case 'integerIdentifierList ' :
212
221
case 'scalarIdentifier ' :
222
+ case 'scalarIdentifierList ' :
213
223
if ($ property ->getClassName ()) {
214
224
$ propertyList [] = $ property ;
215
225
}
0 commit comments