plugin/drop-zone/Controller/API/DropController.php
public function createAction(Dropzone $dropzone, User $user, Team $team = null)
    {
        $this->checkPermission('OPEN', $dropzone->getResourceNode(), [], true);

        if (!empty($team)) {
            $this->checkTeamUser($team, $user);
        }
        try {
            if (empty($team)) {
                // creates a User drop
                $myDrop = $this->manager->getUserDrop($dropzone, $user, true);
            } else {
                // creates a Team drop
                $myDrop = $this->manager->getTeamDrop($dropzone, $team, $user, true);
            }

            return new JsonResponse($this->manager->serializeDrop($myDrop));
        } catch (\Exception $e) {
            return new JsonResponse($e->getMessage(), 422);
        }
    }
public function createAction(Dropzone $dropzone, User $user, Team $team = null)
    {
        $this->checkPermission('OPEN', $dropzone->getResourceNode(), [], true);

        if (!empty($team)) {
            $this->checkTeamUser($team, $user);
        }
        try {
            if (empty($team)) {
                // creates a User drop
                $myDrop = $this->manager->getUserDrop($dropzone, $user, true);
            } else {
                // creates a Team drop
                $myDrop = $this->manager->getTeamDrop($dropzone, $team, $user, true);
            }

            return new JsonResponse($this->manager->serializeDrop($myDrop));
        } catch (\Exception $e) {
            return new JsonResponse($e->getMessage(), 422);
        }
    }
public function createAction ( Dropzone $ dropzone , User $ user , Team $ team = null ) { $ this -> checkPermission ( 'OPEN' , $ dropzone -> getResourceNode ( ) , [ ] , true ) ; if ( ! empty ( $ team ) ) { $ this -> checkTeamUser ( $ team , $ user ) ; } try { if ( empty ( $ team ) ) { // creates a User drop $ myDrop = $ this -> manager -> getUserDrop ( $ dropzone , $ user , true ) ; } else { // creates a Team drop $ myDrop = $ this -> manager -> getTeamDrop ( $ dropzone , $ team , $ user , true ) ; } return new JsonResponse ( $ this -> manager -> serializeDrop ( $ myDrop ) ) ; } catch ( \ Exception $ e ) { return new JsonResponse ( $ e -> getMessage ( ) , 422 ) ; } }
Initializes a Drop for the current User or Team.

@EXT\Route("/{id}/drops/{teamId}", name="claro_dropzone_drop_create", defaults={"teamId"=null})
@EXT\ParamConverter("dropzone", class="ClarolineDropZoneBundle:Dropzone", options={"mapping": {"id": "uuid"}})
@EXT\ParamConverter("team", class="ClarolineTeamBundle:Team", options={"mapping": {"teamId": "uuid"}})
@EXT\ParamConverter("user", converter="current_user", options={"allowAnonymous"=false})
@EXT\Method("POST")

@param Dropzone $dropzone
@param Team     $team
@param User     $user

@return JsonResponse
Initializes a Drop for the current User or Team .