original_string: public function getFieldsData()
      {
          $fieldsData = array();
          foreach ($this->getFields() as $field) {
              $fieldData = $this->$field;
              // If the field is an Entity, decode it.
              if ($fieldData instanceof self) {
                  $fieldData = $fieldData->getFieldsData();
              } elseif (@reset($fieldData) instanceof Entity) {
                  // If the field is an array of Entity, decode them all.
                  $newFieldData = array();
                  foreach ($fieldData as $key => $entity) {
                      $newFieldData[$key] = $entity->getFieldsData();
                  }
                  $fieldData = $newFieldData;
              }
  
              $fieldsData[$field] = $fieldData;
          }
  
          return $fieldsData;
      }
code: public function getFieldsData()
      {
          $fieldsData = array();
          foreach ($this->getFields() as $field) {
              $fieldData = $this->$field;
              // If the field is an Entity, decode it.
              if ($fieldData instanceof self) {
                  $fieldData = $fieldData->getFieldsData();
              } elseif (@reset($fieldData) instanceof Entity) {
                  // If the field is an array of Entity, decode them all.
                  $newFieldData = array();
                  foreach ($fieldData as $key => $entity) {
                      $newFieldData[$key] = $entity->getFieldsData();
                  }
                  $fieldData = $newFieldData;
              }
  
              $fieldsData[$field] = $fieldData;
          }
  
          return $fieldsData;
      }
code_tokens: public function getFieldsData ( ) { $ fieldsData = array ( ) ; foreach ( $ this -> getFields ( ) as $ field ) { $ fieldData = $ this -> $ field ; // If the field is an Entity, decode it. if ( $ fieldData instanceof self ) { $ fieldData = $ fieldData -> getFieldsData ( ) ; } elseif ( @ reset ( $ fieldData ) instanceof Entity ) { // If the field is an array of Entity, decode them all. $ newFieldData = array ( ) ; foreach ( $ fieldData as $ key => $ entity ) { $ newFieldData [ $ key ] = $ entity -> getFieldsData ( ) ; } $ fieldData = $ newFieldData ; } $ fieldsData [ $ field ] = $ fieldData ; } return $ fieldsData ; }
docstring: Returns an array composed of all the persistable fields.
  
  @return array
docstring_tokens: Returns an array composed of all the persistable fields .