protected function persist(QuerySet $queries, $entity, $exclusions = [])
    {
        $metadata = $this->getClassMetadata();

        foreach ($metadata->getFieldMappings() as $field) {
            $fieldName = $field['fieldname'];
            if (in_array($fieldName, $exclusions)) {
                continue;
            }
            // Don't add field to the persistence query if it is not an entity
            // property, and on UPDATE only
            if (!isset($entity->$fieldName) && $entity->getId() !== null) {
                continue;
            }

            $field = $this->getFieldManager()->get($field['fieldtype'], $field);
            if ($field instanceof FieldTypeInterface) {
                $field->persist($queries, $entity);
            }
        }
    }
protected function persist(QuerySet $queries, $entity, $exclusions = [])
    {
        $metadata = $this->getClassMetadata();

        foreach ($metadata->getFieldMappings() as $field) {
            $fieldName = $field['fieldname'];
            if (in_array($fieldName, $exclusions)) {
                continue;
            }
            // Don't add field to the persistence query if it is not an entity
            // property, and on UPDATE only
            if (!isset($entity->$fieldName) && $entity->getId() !== null) {
                continue;
            }

            $field = $this->getFieldManager()->get($field['fieldtype'], $field);
            if ($field instanceof FieldTypeInterface) {
                $field->persist($queries, $entity);
            }
        }
    }
protected function persist ( QuerySet $ queries , $ entity , $ exclusions = [ ] ) { $ metadata = $ this -> getClassMetadata ( ) ; foreach ( $ metadata -> getFieldMappings ( ) as $ field ) { $ fieldName = $ field [ 'fieldname' ] ; if ( in_array ( $ fieldName , $ exclusions ) ) { continue ; } // Don't add field to the persistence query if it is not an entity // property, and on UPDATE only if ( ! isset ( $ entity -> $ fieldName ) && $ entity -> getId ( ) !== null ) { continue ; } $ field = $ this -> getFieldManager ( ) -> get ( $ field [ 'fieldtype' ] , $ field ) ; if ( $ field instanceof FieldTypeInterface ) { $ field -> persist ( $ queries , $ entity ) ; } } }
Internal method to run persist method on each field for the managed entity.

Takes a QuerySet instance as input

@param QuerySet $queries
@param Entity   $entity
@param array    $exclusions
Internal method to run persist method on each field for the managed entity .