Exemplo n.º 1
0
 /**
  * some_field -> someField
  * @param string $table
  * @param string $column
  * @return string
  */
 public function getEntityField($table, $column)
 {
     $class = $this->getEntityClass($table);
     /** @var Entity $entity */
     $entity = new $class();
     $reflection = $entity->getReflection($this);
     foreach ($reflection->getEntityProperties() as $property) {
         if ($property->getColumn() == $column) {
             return Utils::underscoreToCamel($property->getName());
         }
     }
     throw new InvalidArgumentException(sprintf("Could not find property for table '%s' and column '%s'", $table, $column));
 }