public function moveToPermanent() {
//        to keep the save as it is, I need to get the path without the filename and also remove the /tmp
        $destination_path = str_replace($this->getFileName(), '', $this->getPathName());
        // if there is an error when moving the file, an exception will
        // be automatically thrown by move(). This will properly prevent
        // the entity from being persisted to the database on error
        if (null !== $this->getPathName() && $this->getPathName() != $this->prePersistName) {
            $this->move($destination_path);
        }
    }
public function moveToPermanent() {
//        to keep the save as it is, I need to get the path without the filename and also remove the /tmp
        $destination_path = str_replace($this->getFileName(), '', $this->getPathName());
        // if there is an error when moving the file, an exception will
        // be automatically thrown by move(). This will properly prevent
        // the entity from being persisted to the database on error
        if (null !== $this->getPathName() && $this->getPathName() != $this->prePersistName) {
            $this->move($destination_path);
        }
    }
public function moveToPermanent ( ) { //        to keep the save as it is, I need to get the path without the filename and also remove the /tmp $ destination_path = str_replace ( $ this -> getFileName ( ) , '' , $ this -> getPathName ( ) ) ; // if there is an error when moving the file, an exception will // be automatically thrown by move(). This will properly prevent // the entity from being persisted to the database on error if ( null !== $ this -> getPathName ( ) && $ this -> getPathName ( ) != $ this -> prePersistName ) { $ this -> move ( $ destination_path ) ; } }
When the file persists, if it is in the tmp subdir, it will be move before save.
@ORM\PostPersist()
@ORM\PostUpdate()
When the file persists if it is in the tmp subdir it will be move before save .