public function persist($entity, $version = 'guess') {
        $this->entities->persist($entity);

        if($version === 'new' || ($version === 'guess' && $this->needsNewVersion($entity))) {
            $this->makeNewVersion($entity, false);
            $return = true;
        } else {
            $return = false;
        }

        $this->entities->flush();

        return $return;
    }
public function persist($entity, $version = 'guess') {
        $this->entities->persist($entity);

        if($version === 'new' || ($version === 'guess' && $this->needsNewVersion($entity))) {
            $this->makeNewVersion($entity, false);
            $return = true;
        } else {
            $return = false;
        }

        $this->entities->flush();

        return $return;
    }
public function persist ( $ entity , $ version = 'guess' ) { $ this -> entities -> persist ( $ entity ) ; if ( $ version === 'new' || ( $ version === 'guess' && $ this -> needsNewVersion ( $ entity ) ) ) { $ this -> makeNewVersion ( $ entity , false ) ; $ return = true ; } else { $ return = false ; } $ this -> entities -> flush ( ) ; return $ return ; }
Persists an entity. Creating a new version of it if needed.

@param object $entity
@param string $version
@return boolean true if a new version was created
Persists an entity . Creating a new version of it if needed .