original_string: public function apply(ModelCriteria $query)
      {
          if (!empty($this->modifiers)) {
              foreach ($this->modifiers as $modifier) {
                  if ($this->hasAllRequiredData($modifier)) {
                      $modifier['property'] = str_replace('/', '.', $modifier['property']);
                      # Check if the filter is occurring on a related model
                      if (strpos($modifier['property'], '.') !== false) {
                          $propertyParts = explode('.', $modifier['property']);
  
                          # The last part is the related property we want to filter with, so remove it from the parts and store into a variable
                          $propertyField = array_pop($propertyParts);
                          # The new last part is the relation name
                          $relationName = array_pop($propertyParts);
  
                          # Apply the modifier
                          $this->applyModifier($query, $this->buildClause($propertyField, $relationName), $modifier);
                      } else {
                          # Apply the modifier
                          $this->applyModifier($query,
                              $this->buildClause($modifier['property'], $query->getModelShortName()),
                              $modifier);
                      }
                  }
              }
          }
      }
code: public function apply(ModelCriteria $query)
      {
          if (!empty($this->modifiers)) {
              foreach ($this->modifiers as $modifier) {
                  if ($this->hasAllRequiredData($modifier)) {
                      $modifier['property'] = str_replace('/', '.', $modifier['property']);
                      # Check if the filter is occurring on a related model
                      if (strpos($modifier['property'], '.') !== false) {
                          $propertyParts = explode('.', $modifier['property']);
  
                          # The last part is the related property we want to filter with, so remove it from the parts and store into a variable
                          $propertyField = array_pop($propertyParts);
                          # The new last part is the relation name
                          $relationName = array_pop($propertyParts);
  
                          # Apply the modifier
                          $this->applyModifier($query, $this->buildClause($propertyField, $relationName), $modifier);
                      } else {
                          # Apply the modifier
                          $this->applyModifier($query,
                              $this->buildClause($modifier['property'], $query->getModelShortName()),
                              $modifier);
                      }
                  }
              }
          }
      }
code_tokens: public function apply ( ModelCriteria $ query ) { if ( ! empty ( $ this -> modifiers ) ) { foreach ( $ this -> modifiers as $ modifier ) { if ( $ this -> hasAllRequiredData ( $ modifier ) ) { $ modifier [ 'property' ] = str_replace ( '/' , '.' , $ modifier [ 'property' ] ) ; # Check if the filter is occurring on a related model if ( strpos ( $ modifier [ 'property' ] , '.' ) !== false ) { $ propertyParts = explode ( '.' , $ modifier [ 'property' ] ) ; # The last part is the related property we want to filter with, so remove it from the parts and store into a variable $ propertyField = array_pop ( $ propertyParts ) ; # The new last part is the relation name $ relationName = array_pop ( $ propertyParts ) ; # Apply the modifier $ this -> applyModifier ( $ query , $ this -> buildClause ( $ propertyField , $ relationName ) , $ modifier ) ; } else { # Apply the modifier $ this -> applyModifier ( $ query , $ this -> buildClause ( $ modifier [ 'property' ] , $ query -> getModelShortName ( ) ) , $ modifier ) ; } } } } }
docstring: Apply the filter to the ModelQuery
  
  @param \Propel\Runtime\ActiveQuery\ModelCriteria $query
docstring_tokens: Apply the filter to the ModelQuery