bundle/Core/Persistence/Anonymizer/AnonymizerServiceFacade.php
public function anonymize($contentId, array $fields = [], DateTime $date = null)
    {
        $fieldsWithIds = $this->getFieldIds($contentId, $fields);

        if (!empty($fields) && empty($fieldsWithIds)) {
            return 0;
        }

        $collections = $this->getCollections($contentId, $date);

        foreach ($collections as $collection) {
            $this->anonymizer->anonymizeCollection($collection, $fields);
        }

        return count($collections);
    }
public function anonymize($contentId, array $fields = [], DateTime $date = null)
    {
        $fieldsWithIds = $this->getFieldIds($contentId, $fields);

        if (!empty($fields) && empty($fieldsWithIds)) {
            return 0;
        }

        $collections = $this->getCollections($contentId, $date);

        foreach ($collections as $collection) {
            $this->anonymizer->anonymizeCollection($collection, $fields);
        }

        return count($collections);
    }
public function anonymize ( $ contentId , array $ fields = [ ] , DateTime $ date = null ) { $ fieldsWithIds = $ this -> getFieldIds ( $ contentId , $ fields ) ; if ( ! empty ( $ fields ) && empty ( $ fieldsWithIds ) ) { return 0 ; } $ collections = $ this -> getCollections ( $ contentId , $ date ) ; foreach ( $ collections as $ collection ) { $ this -> anonymizer -> anonymizeCollection ( $ collection , $ fields ) ; } return count ( $ collections ) ; }
Anonymize collections by content id

@param int $contentId Content id
@param array $fields Fields list
@param DateTime|null $date Anonymize collections older that this date

@return int
Anonymize collections by content id