getPropertyFor() public method

Get the name of the property matching the given function
public getPropertyFor ( string $fn ) : string | null
$fn string
return string | null
Beispiel #1
0
 /**
  * Check if $method refers to a related entity, if it does then use the EntityManager to hydrate that entity
  *
  * @param string $method
  * @return $this
  */
 private function examineMethodForHydration($method)
 {
     $property = $this->metadata->getPropertyFor($method);
     if ($property) {
         $relative = $this->metadata->getRelationshipByName($property);
         if ($relative) {
             if ($relative->getSetter() == $method) {
                 $this->proxy->setRelativeModified($property);
                 $this->hydrated_methods[$method] = true;
                 $this->hydrated_methods[$relative->getGetter()] = true;
             } elseif ($relative->getGetter() == $method) {
                 if (!isset($this->hydrated_methods[$method])) {
                     $this->hydrateRelative($relative);
                     $this->hydrated_methods[$method] = true;
                     $this->hydrated_methods[$relative->getSetter()] = true;
                 }
             }
         }
     }
     return $this;
 }