original_string: protected function entityToArray($class, $object)
      {
          if (is_object($object) && get_class($object) == $class) {
              $object = $object->toArray();
          }
          return $object;
      }
code: protected function entityToArray($class, $object)
      {
          if (is_object($object) && get_class($object) == $class) {
              $object = $object->toArray();
          }
          return $object;
      }
code_tokens: protected function entityToArray ( $ class , $ object ) { if ( is_object ( $ object ) && get_class ( $ object ) == $ class ) { $ object = $ object -> toArray ( ) ; } return $ object ; }
docstring: Return entity transformed to array
  
  @param string $class  Entity class
  @param mixed  $object Entity object or array
  
  @return array
docstring_tokens: Return entity transformed to array