Creates a form to create a Message entity.

@param File $entity The entity

@return \Symfony\Component\Form\Form The form
163563
public function createCreateForm(SakonninFile $entity)
    {
        $form = $this->createForm(\BisonLab\SakonninBundle\Form\SakonninFileType::class, $entity, array(
            'action' => $this->generateUrl('file_new'),
            'method' => 'POST',
        ));
        $form->add('file', VichFileType::class, [
            'required' => true,
            'allow_delete' => true,
        ]);
        $form->add('submit', SubmitType::class, array('label' => 'Engage'));

        return $form;
    }
1362001
private function createMenuItemCreateForm(MenuItem $entity)
    {
        $form = $this->createForm(new MenuItemType(), $entity, array(
            'action' => $this->generateUrl('admin_menu_item_create', array('id' => $entity->getMenu()->getId())),
            'method' => 'POST',
        ));

        $form->add('submit', 'submit', array('label' => 'Create'));

        return $form;
    }
205737
private function createCreateForm(MessageType $entity)
    {
        $form = $this->createForm(MessageTypeType::class, $entity, array(
            'action' => $this->generateUrl('messagetype_create'),
            'method' => 'POST',
        ));
        $this->_addFunctionsToForm($form);

        $form->add('create_group', CheckboxType::class, array('label' => "This is a new group.", 'mapped' => false, 'required' => false));
        $form->add('submit', SubmitType::class, array('label' => 'Create'));

        return $form;
    }
1136075
public function prepare(File $file, $entity, $field, $noclobber = true, $forceFilename = '')
    {
        $dir = $this->getDir($entity, $field);
        if ($forceFilename) {
            $pathname = $dir . '/' . $forceFilename;
        } else {
            if ($file instanceof UploadedFile) {
                $fileName = $file->getClientOriginalName();
            } else {
                $fileName = $file->getBasename();
            }

            $i = 0;
            do {
                $f = $this->namingStrategy->normalize($fileName, $i++);
                $pathname = $dir . '/' . $f;
            } while ($noclobber && $this->fs->exists($pathname));
            $this->fs->mkdir(dirname($pathname), 0777 & ~umask(), true);
            $this->fs->touch($pathname);
        }
        $this->preparedPaths[]= $pathname;
        return $pathname;
    }
1133230
private function createEditForm(Report $entity)
    {
        $form = $this->createForm('chill_reportbundle_report', $entity, array(
            'action' => $this->generateUrl('report_update', 
                array('person_id' => $entity->getPerson()->getId(), 
                    'report_id' => $entity->getId())),
            'method' => 'PUT',
            'cFGroup' => $entity->getCFGroup(),
            'role' => new Role('CHILL_REPORT_UPDATE'),
            'center' => $entity->getPerson()->getCenter()
        ));

        return $form;
    }
60734
public function createCopyForm($entity, $entityClass)
    {
        return $this->createIdForm($entity, 'copy_', $this->adminRouter->generate($entity, $entityClass, AdminRouter::TYPE_COPY));
    }
982880
public function setFile(\BiberLtd\Bundle\FileManagementBundle\Entity\File $file) {
        if($this->setModified('file', $file)->isModified()) {
            $this->file = $file;
        }

        return $this;
    }
1073671
public function fileOpen($path, $mode, $options, &$entity)
  {
    $entity = $this->getEntity($path);

    $filePointer = null;
    if (!is_null($entity)) {
      $exists = $entity->file_exists();

      if ($exists && !$entity->is_file()) {
        $filePointer = null;
      } else {
        $fopenWillFail = false;
        $mode = strtolower($mode);
        if ($mode != "r") {
          $isVirtual = ($entity instanceof Entity_Virtual_Interface);
          if (!$exists || !$isVirtual) {
            /* @var $entity Entity */
            $tmpPath = $this->_files->tempnam();
            $basename = basename($path);

            if ($exists) {
              if ($mode == "x" || $mode == "x+") {
                $fopenWillFail = true;
              } else {
                copy($entity->path(), $tmpPath);
              }
            }
            if (!$fopenWillFail) {
              $entity = Entity_Virtual::newInstance(
                $entity, $tmpPath, $basename
              );

              $changes = $this->getChanges();
              $changes->add($path, $entity);
            }
          }
        }

        if ($fopenWillFail) {
          $entity = null;
        } else {
          if ($options & STREAM_REPORT_ERRORS) {
            $filePointer = fopen($entity->path(), $mode);
          } else {
            $filePointer = @fopen($entity->path(), $mode);
          }
        }
      }
    }

    return $filePointer;
  }
170104
private function createMenuItemEditForm(MenuItem $entity)
    {
        $form = $this->createForm(new MenuItemType(), $entity, array(
            'action' => $this->generateUrl('admin_menu_item_update', array('id' => $entity->getId())),
            'method' => 'PUT',
        ));

        $form->add('submit', 'submit', array('label' => 'Update'));

        return $form;
    }
664394
public static function generateDeleteRequest( Entity $entity ) {
        /* Generate the DeleteRequest message */
        $deleteRequestDOM = new DOMDocument();
        $deleteNode       = $deleteRequestDOM->appendChild( $deleteRequestDOM->createElementNS( 'http://schemas.microsoft.com/xrm/2011/Contracts/Services', 'Delete' ) );
        $deleteNode->appendChild( $deleteRequestDOM->createElement( 'entityName', $entity->logicalName ) );
        $deleteNode->appendChild( $deleteRequestDOM->createElement( 'id', $entity->ID ) );

        /* Return the DOMNode */

        return $deleteNode;
    }
937148
private function createEditForm(GalleryItem $entity)
    {
        $form = $this->createForm(new GalleryItemType(), $entity, array(
            'action' => $this->generateUrl('admin_galleryitem_update', array('id' => $entity->getId())),
            'method' => 'PUT',
        ));

        $form->add('submit', 'submit', array('label' => 'Update'));

        return $form;
    }
1046831
public function createFromEntity ($entity)
    {
        // Persist it
        $this->em->persist($entity);
        $this->em->flush();

        // Convert it to model and cache it
        $Model                  = $this->_convertEntityToModel($entity);
        $this->cache[$entity->getId()] = $Model;

        return $Model;
    }
1005454
private function createBlockCreateForm(Block $entity)
    {

        $types = $this->container->getParameter('flowcode_page.block_types');
        $class = $types[$entity->getType()]["class_type"];

        $form = $this->createForm(new $class(), $entity, array(
            'action' => $this->generateUrl('admin_page_block_create', array("type" => $entity->getType())),
            'method' => 'POST',
        ));

        $form->add('submit', 'submit', array('label' => 'Create'));

        return $form;
    }
697106
private function createEditForm(Menu $entity)
    {
        $form = $this->createForm(new MenuType(), $entity, array(
            'action' => $this->generateUrl('admin_menu_update', array('id' => $entity->getId())),
            'method' => 'PUT',
        ));

        $form->add('submit', 'submit', array('label' => 'Update'));

        return $form;
    }
505637
public function create(FileResource $file)
    {
        $path = $this->buildUsersPath();
        $builder = (new MultipartStreamBuilder())->addResource($file->getName(), $file->getResource(), $file->getOptions());
        $headers = ['Content-Type' => sprintf('multipart/form-data; boundary="%s"', $builder->getBoundary())];

        return $this->postRaw($path, $builder->build(), $headers);
    }
438853
def create_entity(file, io = nil, properties = {})
      params = { deviceid: @device_id, serviceid: @service_id, filename: file.name, type: file.type }.merge(properties)
      params[:parentid] = file.parent_id unless file.parent_id.nil?

      if params[:properties]
        params[:properties] = params[:properties].to_json
      end

      file_handle = unless file.id
        response = get('/createFile', params)
        File.from_json(response.body['file'])
      else
        file
      end

      if io
        HttpHelper.send_file(files_url, @token, @device_id, @service_id, file_handle, io, @logger)
        file_handle.size = io.size
      end

      file_handle
    end
1090816
private function createCreateForm(UserGroup $entity)
    {
        $options = array ('action' => $this->generateUrl('admin_usergroup_create'),
                          'method' => 'POST'
                         );

        $form = $this->createForm(new UserGroupType(), $entity, $options);

        return $form;
    }