plugin/drop-zone/Manager/DropzoneManager.php
public function getUserDrop(Dropzone $dropzone, User $user, $withCreation = false)
    {
        $drops = $this->dropRepo->findBy(['dropzone' => $dropzone, 'user' => $user, 'teamUuid' => null]);
        $drop = count($drops) > 0 ? $drops[0] : null;

        if (empty($drop) && $withCreation) {
            $this->om->startFlushSuite();
            $drop = new Drop();
            $drop->setUser($user);
            $drop->setDropzone($dropzone);
            $this->om->persist($drop);

            $this->resourceEvalManager->createResourceEvaluation(
                $dropzone->getResourceNode(),
                $user,
                null,
                ['status' => AbstractResourceEvaluation::STATUS_INCOMPLETE]
            );
            $this->om->endFlushSuite();

            $this->eventDispatcher->dispatch('log', new LogDropStartEvent($dropzone, $drop));
        }

        return $drop;
    }
public function getUserDrop(Dropzone $dropzone, User $user, $withCreation = false)
    {
        $drops = $this->dropRepo->findBy(['dropzone' => $dropzone, 'user' => $user, 'teamUuid' => null]);
        $drop = count($drops) > 0 ? $drops[0] : null;

        if (empty($drop) && $withCreation) {
            $this->om->startFlushSuite();
            $drop = new Drop();
            $drop->setUser($user);
            $drop->setDropzone($dropzone);
            $this->om->persist($drop);

            $this->resourceEvalManager->createResourceEvaluation(
                $dropzone->getResourceNode(),
                $user,
                null,
                ['status' => AbstractResourceEvaluation::STATUS_INCOMPLETE]
            );
            $this->om->endFlushSuite();

            $this->eventDispatcher->dispatch('log', new LogDropStartEvent($dropzone, $drop));
        }

        return $drop;
    }
public function getUserDrop ( Dropzone $ dropzone , User $ user , $ withCreation = false ) { $ drops = $ this -> dropRepo -> findBy ( [ 'dropzone' => $ dropzone , 'user' => $ user , 'teamUuid' => null ] ) ; $ drop = count ( $ drops ) > 0 ? $ drops [ 0 ] : null ; if ( empty ( $ drop ) && $ withCreation ) { $ this -> om -> startFlushSuite ( ) ; $ drop = new Drop ( ) ; $ drop -> setUser ( $ user ) ; $ drop -> setDropzone ( $ dropzone ) ; $ this -> om -> persist ( $ drop ) ; $ this -> resourceEvalManager -> createResourceEvaluation ( $ dropzone -> getResourceNode ( ) , $ user , null , [ 'status' => AbstractResourceEvaluation :: STATUS_INCOMPLETE ] ) ; $ this -> om -> endFlushSuite ( ) ; $ this -> eventDispatcher -> dispatch ( 'log' , new LogDropStartEvent ( $ dropzone , $ drop ) ) ; } return $ drop ; }
Gets user drop or creates one.

@param Dropzone $dropzone
@param User     $user
@param bool     $withCreation

@return Drop
Gets user drop or creates one .