public function freez(Registry $doctrine)
    {
        $em = $doctrine->getManager();
        // create reference to existing entity
        if ($this->country) {
            $this->country = $em->getReference(get_class($this->country), $this->country->getId());
        }
        if ($this->storage) {
            $this->storage = $em->getReference(get_class($this->storage), $this->storage->getId());
        }
        $this->type = $em->getReference(get_class($this->type), $this->type->getId());
        foreach ($this->genres as $key => $genre) {
            $this->genres[$key] = $em->getReference(get_class($genre), $genre->getId());
        }

        return $this;
    }
public function freez(Registry $doctrine)
    {
        $em = $doctrine->getManager();
        // create reference to existing entity
        if ($this->country) {
            $this->country = $em->getReference(get_class($this->country), $this->country->getId());
        }
        if ($this->storage) {
            $this->storage = $em->getReference(get_class($this->storage), $this->storage->getId());
        }
        $this->type = $em->getReference(get_class($this->type), $this->type->getId());
        foreach ($this->genres as $key => $genre) {
            $this->genres[$key] = $em->getReference(get_class($genre), $genre->getId());
        }

        return $this;
    }
public function freez ( Registry $ doctrine ) { $ em = $ doctrine -> getManager ( ) ; // create reference to existing entity if ( $ this -> country ) { $ this -> country = $ em -> getReference ( get_class ( $ this -> country ) , $ this -> country -> getId ( ) ) ; } if ( $ this -> storage ) { $ this -> storage = $ em -> getReference ( get_class ( $ this -> storage ) , $ this -> storage -> getId ( ) ) ; } $ this -> type = $ em -> getReference ( get_class ( $ this -> type ) , $ this -> type -> getId ( ) ) ; foreach ( $ this -> genres as $ key => $ genre ) { $ this -> genres [ $ key ] = $ em -> getReference ( get_class ( $ genre ) , $ genre -> getId ( ) ) ; } return $ this ; }
Freeze item.

@param Registry $doctrine

@return Item
Freeze item .