original_string: public function getManagedFields($entity)
      {
          $class = get_class($entity);
  
          if (!isset($this->managedFields[$class])) {
              $entityClass = get_class($entity);
              $this->managedFields[$class] = array();
              do {
                  $metadata = $this->metadataFactory->getMetadataForClass($entityClass);
                  foreach ($metadata->propertyMetadata as $field => $metadata) {
                      if (isset($metadata->fileManager)) {
                          $this->managedFields[$class][] =$field;
                      }
                  }
              } while ($entityClass = get_parent_class($entityClass));
              $this->managedFields[$class] = array_unique($this->managedFields[$class]);
          }
          return $this->managedFields[$class];
      }
code: public function getManagedFields($entity)
      {
          $class = get_class($entity);
  
          if (!isset($this->managedFields[$class])) {
              $entityClass = get_class($entity);
              $this->managedFields[$class] = array();
              do {
                  $metadata = $this->metadataFactory->getMetadataForClass($entityClass);
                  foreach ($metadata->propertyMetadata as $field => $metadata) {
                      if (isset($metadata->fileManager)) {
                          $this->managedFields[$class][] =$field;
                      }
                  }
              } while ($entityClass = get_parent_class($entityClass));
              $this->managedFields[$class] = array_unique($this->managedFields[$class]);
          }
          return $this->managedFields[$class];
      }
code_tokens: public function getManagedFields ( $ entity ) { $ class = get_class ( $ entity ) ; if ( ! isset ( $ this -> managedFields [ $ class ] ) ) { $ entityClass = get_class ( $ entity ) ; $ this -> managedFields [ $ class ] = array ( ) ; do { $ metadata = $ this -> metadataFactory -> getMetadataForClass ( $ entityClass ) ; foreach ( $ metadata -> propertyMetadata as $ field => $ metadata ) { if ( isset ( $ metadata -> fileManager ) ) { $ this -> managedFields [ $ class ] [ ] = $ field ; } } } while ( $ entityClass = get_parent_class ( $ entityClass ) ) ; $ this -> managedFields [ $ class ] = array_unique ( $ this -> managedFields [ $ class ] ) ; } return $ this -> managedFields [ $ class ] ; }
docstring: Returns all field names that are managed
  
  @param mixed $entity
  @return array
docstring_tokens: Returns all field names that are managed