public function strainAction()
    {
        $id = $this->getRequest()->get($this->admin->getIdParameter());
        $object = $this->admin->getObject($id);
        $strain = clone $object;

        $strain->setIsStrain(true);
        $strain->setParent($object);

        $fieldSets = ['Professional', 'Amateur', 'Production', 'Commercial', 'Plant', 'Culture', 'Inner'];

        foreach ($fieldSets as $label) {
            $getter = 'get' . $label . 'Descriptions';
            $adder = 'add' . $label . 'Description';
            $collection = $object->$getter();
            $collection->initialize();

            foreach ($collection as $desc) {
                $new = clone $desc;
                $strain->$adder($new);
            }
        }

        $this->duplicateFiles($object, $strain);

        foreach ($object->getPlantCategories() as $cat) {
            $strain->addPlantCategory($cat);
        }

        return $this->createAction($strain);
    }
public function strainAction()
    {
        $id = $this->getRequest()->get($this->admin->getIdParameter());
        $object = $this->admin->getObject($id);
        $strain = clone $object;

        $strain->setIsStrain(true);
        $strain->setParent($object);

        $fieldSets = ['Professional', 'Amateur', 'Production', 'Commercial', 'Plant', 'Culture', 'Inner'];

        foreach ($fieldSets as $label) {
            $getter = 'get' . $label . 'Descriptions';
            $adder = 'add' . $label . 'Description';
            $collection = $object->$getter();
            $collection->initialize();

            foreach ($collection as $desc) {
                $new = clone $desc;
                $strain->$adder($new);
            }
        }

        $this->duplicateFiles($object, $strain);

        foreach ($object->getPlantCategories() as $cat) {
            $strain->addPlantCategory($cat);
        }

        return $this->createAction($strain);
    }
public function strainAction ( ) { $ id = $ this -> getRequest ( ) -> get ( $ this -> admin -> getIdParameter ( ) ) ; $ object = $ this -> admin -> getObject ( $ id ) ; $ strain = clone $ object ; $ strain -> setIsStrain ( true ) ; $ strain -> setParent ( $ object ) ; $ fieldSets = [ 'Professional' , 'Amateur' , 'Production' , 'Commercial' , 'Plant' , 'Culture' , 'Inner' ] ; foreach ( $ fieldSets as $ label ) { $ getter = 'get' . $ label . 'Descriptions' ; $ adder = 'add' . $ label . 'Description' ; $ collection = $ object -> $ getter ( ) ; $ collection -> initialize ( ) ; foreach ( $ collection as $ desc ) { $ new = clone $ desc ; $ strain -> $ adder ( $ new ) ; } } $ this -> duplicateFiles ( $ object , $ strain ) ; foreach ( $ object -> getPlantCategories ( ) as $ cat ) { $ strain -> addPlantCategory ( $ cat ) ; } return $ this -> createAction ( $ strain ) ; }
Creates a strain from a variety and passes it to create action.

@return Response
Creates a strain from a variety and passes it to create action .