Ejemplo n.º 1
0
 private function addPermissionableConditionIfNot(HasMany $relation)
 {
     $foundGroupCondition = false;
     $query = $relation->getQuery();
     foreach ($query->getWhere() as $where) {
         foreach ($where->getChildren() as $key => $child) {
             if (strpos($key, $this->permissionablePermissionField)) {
                 $foundGroupCondition = true;
             }
         }
     }
     if (!$foundGroupCondition) {
         $this->addPermissionableCondition($relation);
     }
 }
Ejemplo n.º 2
0
 private function addTranslatableConditionIfNot(HasMany $relation)
 {
     $foundLanguageCondition = false;
     $query = $relation->getQuery();
     foreach ($query->getWhere() as $where) {
         foreach ($where->getChildren() as $key => $child) {
             if (strpos($key, $this->translatableLanguageField)) {
                 $foundLanguageCondition = true;
             }
         }
     }
     if (!$foundLanguageCondition) {
         $this->addTranslatableCondition($relation);
     }
 }