indexable = $indexable; $this->objectClass = $objectClass; $this->objectPersister = $objectPersister; $this->options = array_merge(array( 'batch_size' => 100, ), $options); } /** * Checks if a given object should be indexed or not. * * @param object $object * * @return bool */ protected function isObjectIndexable($object) { return $this->indexable->isObjectIndexable( $this->options['indexName'], $this->options['typeName'], $object ); } /** * Get string with RAM usage information (current and peak). * * @deprecated To be removed in 4.0 * * @return string */ protected function getMemoryUsage() { $memory = round(memory_get_usage() / (1024 * 1024)); // to get usage in Mo $memoryMax = round(memory_get_peak_usage() / (1024 * 1024)); // to get max usage in Mo return sprintf('(RAM : current=%uMo peak=%uMo)', $memory, $memoryMax); } }