original_string: public function objectIndexActionRequired($object, Client $client = null)
      {
          $type = $this->getIndexTypeForObject($object, $client);
          if ($type === null) {
              return null;
          }
          $id = $this->persistenceManager->getIdentifierByObject($object);
          $document = $type->findDocumentById($id);
          if ($document !== null) {
              $objectData = $this->getIndexablePropertiesAndValuesFromObject($object);
              if (strcmp(json_encode($objectData), json_encode($document->getData())) === 0) {
                  $actionType = null;
              } else {
                  $actionType = self::ACTION_TYPE_UPDATE;
              }
          } else {
              $actionType = self::ACTION_TYPE_CREATE;
          }
  
          return $actionType;
      }
code: public function objectIndexActionRequired($object, Client $client = null)
      {
          $type = $this->getIndexTypeForObject($object, $client);
          if ($type === null) {
              return null;
          }
          $id = $this->persistenceManager->getIdentifierByObject($object);
          $document = $type->findDocumentById($id);
          if ($document !== null) {
              $objectData = $this->getIndexablePropertiesAndValuesFromObject($object);
              if (strcmp(json_encode($objectData), json_encode($document->getData())) === 0) {
                  $actionType = null;
              } else {
                  $actionType = self::ACTION_TYPE_UPDATE;
              }
          } else {
              $actionType = self::ACTION_TYPE_CREATE;
          }
  
          return $actionType;
      }
code_tokens: public function objectIndexActionRequired ( $ object , Client $ client = null ) { $ type = $ this -> getIndexTypeForObject ( $ object , $ client ) ; if ( $ type === null ) { return null ; } $ id = $ this -> persistenceManager -> getIdentifierByObject ( $ object ) ; $ document = $ type -> findDocumentById ( $ id ) ; if ( $ document !== null ) { $ objectData = $ this -> getIndexablePropertiesAndValuesFromObject ( $ object ) ; if ( strcmp ( json_encode ( $ objectData ) , json_encode ( $ document -> getData ( ) ) ) === 0 ) { $ actionType = null ; } else { $ actionType = self :: ACTION_TYPE_UPDATE ; } } else { $ actionType = self :: ACTION_TYPE_CREATE ; } return $ actionType ; }
docstring: Returns if, and what, treatment an object requires regarding the index state,
  i.e. it checks the given object against the index and tells whether deletion, update or creation is required.
  
  @param object $object
  @param Client $client
  @return string one of this' ACTION_TYPE_* constants or NULL if no action is required
docstring_tokens: Returns if and what treatment an object requires regarding the index state i . e . it checks the given object against the index and tells whether deletion update or creation is required .