Creates an instance of an entity.

This method must return always an empty instance for related entity

@return BannerZoneInterface New BannerZone instance
19550
public function create()
    {
        /**
         * @var BannerZoneInterface $bannerZone
         */
        $classNamespace = $this->getEntityNamespace();
        $bannerZone = new $classNamespace();
        $bannerZone->setBanners(new ArrayCollection());

        return $bannerZone;
    }
118500
public function create()
    {
        $entities  = [];
        $exclusive = $this->getExclusiveRules();
        if (count($exclusive)) {
            // Create an entry for *each* exclusivity rule as they will end up with different dates of exclusivity
            // expiration. Any of these entries will suffice for duplicate checking and limit checking.
            foreach ($exclusive as $rule) {
                if (!isset($entity)) {
                    $entity = $this->createEntity();
                } else {
                    // No need to re-run all the getters and setters.
                    $entity = clone $entity;
                }
                // Each entry may have different exclusion expiration.
                $expireDate = $this->getRepository()->oldestDateAdded(
                    $rule['duration'],
                    $this->getTimezone(),
                    $this->dateSend
                );
                $entity->setExclusiveExpireDate($expireDate);
                $entity->setExclusivePattern($rule['matching']);
                $entity->setExclusiveScope($rule['scope']);
                $entities[] = $entity;
            }
        } else {
            // A single entry will suffice for all duplicate checking and limit checking.
            $entities[] = $this->createEntity();
        }
        if (count($entities)) {
            $this->getRepository()->saveEntities($entities);
            $this->em->clear('MauticPlugin\MauticContactClientBundle\Entity\Cache');
        }
    }
132017
public function create()
    {
        // Event
        $this->triggerEvent('onBefore' . ucfirst(__FUNCTION__), []);

        $this->triggerEvent('onBeforeStore');

        // Do Action
        $this->getDataMapper()->createOne($this);

        // Event
        $this->triggerEvent('onAfterStore');

        $this->triggerEvent('onAfter' . ucfirst(__FUNCTION__));

        return $this;
    }
720008
public function create()
    {
        $instance = self::createDiscountCoupon($this);
        $this->setId($instance->getId());
        return $instance;
    }
386603
public function createAction()
    {
        // Load form
        $entityClass = $this->getModuleNamespace() . '\Entity\\' . $this->getEntityName();
        $entity      = new $entityClass();
        $form        = $this->getForm('Create' . $this->getEntityName());
        $form->bind($entity);

        // Implement Post/Redirect/Get pattern
        $prg = $this->prg();
        if ($prg instanceof Response) {
            return $prg;
        } else if (false !== $prg) {

            // Set form data
            $form->setData($prg);

            // Create account
            $result = $this->getService()->create();
            if ($result) {
                return $this->redirect()->toRoute($this->indexRoute);
            }
        }

        // Set up view model
        $viewModel = new ViewModel(array(
            'entityName' => $this->getEntityName(),
            'form'       => $form,
        ));
        $viewModel->setTemplate('infinity-base/crud/create');

        return $viewModel;
    }
1078663
public function create()
    {
        $instance = self::createOrderLineItem($this);
        $this->setId($instance->getId());
        return $instance;
    }
839981
public function createMessage() {
        $message = new Message($this->getContext());
        $this->addChild($message);
        $qry = new CreateEntityQuery($message);
        $this->getContext()->addQuery($qry, $message);
        return $message;
    }
373848
public function instance()
    {
        $settings = $this->getValidatedSettings();

        $objectManager = $this->createObjectManager($settings);
        $logger = isset($settings['logger']) ? isset($settings['logger']) : null;

        $this->initializeRegistry($objectManager, $logger);

        return new DataMapper($objectManager);
    }
716820
public function create()
    {
        $instance = self::createPaymentTransaction($this);
        $this->setId($instance->getId());
        return $instance;
    }
668934
public function build(): GetRelayoutBoundaryRequest
	{
		$instance = new GetRelayoutBoundaryRequest();
		if ($this->nodeId === null) {
			throw new BuilderException('Property [nodeId] is required.');
		}
		$instance->nodeId = $this->nodeId;
		return $instance;
	}
554086
public function create()
    {
        $instance = self::createStoreCredit($this);
        $this->setId($instance->getId());
        return $instance;
    }
1331148
public function create()
    {
        $instance = self::createCategory($this);
        $this->setId($instance->getId());
        return $instance;
    }
374263
public function create()
    {
        $instance = self::createFreeShippingPromotion($this);
        $this->setId($instance->getId());
        return $instance;
    }
1194083
public static function create()
    {
        return parent::create()
            ->setSerializationContextFactory(array(self::class, 'createDefaultSerializationContext'))
            ->addDefaultHandlers()
            ->configureListeners(function (EventDispatcher $dispatcher) {
                $proxySubscriber = new DoctrineProxySubscriber(false);
                $dispatcher->addSubscriber($proxySubscriber);
            })
            ->configureHandlers(function (HandlerRegistryInterface $handlerRegistry) {
                $proxyHandler = new DoctrineProxyHandler();
                $handlerRegistry->registerSubscribingHandler($proxyHandler);
            })
        ;
    }
1152270
public function create()
    {
        $instance = self::createFreeShippingCoupon($this);
        $this->setId($instance->getId());
        return $instance;
    }
1366038
public function build(): SetAdBlockingEnabledRequest
	{
		$instance = new SetAdBlockingEnabledRequest();
		if ($this->enabled === null) {
			throw new BuilderException('Property [enabled] is required.');
		}
		$instance->enabled = $this->enabled;
		return $instance;
	}
657937
public function createEmpty()
    {
        $entity = new Entity($this->definition);
        $fields = $this->definition->getEditableFieldNames();
        foreach ($fields as $field) {
            $value = null;
            if ($this->definition->getType($field) == 'fixed') {
                $value = $this->definition->getField($field, 'value');
            }
            $entity->set($field, $value);
        }
        $entity->set('id', null);
        return $entity;
    }