Sulu\Bundle\ContactBundle\Contact\AbstractContactManager::resetIndexOfSubentites PHP Méthode

resetIndexOfSubentites() private méthode

TODO: this is just a hack to avoid relations that start with index != 0 otherwise deserialization process will parse relations as object instead of an array reindex entities.
private resetIndexOfSubentites ( mixed $entities )
$entities mixed
    private function resetIndexOfSubentites($entities)
    {
        if (count($entities) > 0 && method_exists($entities, 'getValues')) {
            $newEntities = $entities->getValues();
            $entities->clear();
            foreach ($newEntities as $value) {
                $entities->add($value);
            }
        }
        return $entities;
    }