ArrayCollection example

private $name;

    /** * @var int|null * * @ORM\Column(name="active", type="integer", nullable=true) */
    private $active;

    public function __construct()
    {
        $this->countries = new ArrayCollection();
    }

    /** * @return int */
    public function getId()
    {
        return $this->id;
    }

    /** * @param string $name * * @return Area */
/** * @var ArrayCollection<\Shopware\Models\Article\Article> * * @ORM\OneToMany(targetEntity="Shopware\Models\Article\Article", mappedBy="propertyGroup", fetch="EXTRA_LAZY") * @ORM\JoinColumn(name="id", referencedColumnName="filtergroupID") */
    private $articles;

    public function __construct()
    {
        $this->options = new ArrayCollection();
        $this->articles = new ArrayCollection();
        $this->relations = new ArrayCollection();
    }

    /** * @return int */
    public function getId()
    {
        return $this->id;
    }

    
private $description;

    /** * @var DateTimeInterface * * @ORM\Column(name="changed", type="datetime", nullable=false) */
    private $changed;

    public function __construct()
    {
        $this->articles = new ArrayCollection();
        $this->changed = new DateTime();
    }

    /** * Sets the primary key * * @param int $id */
    public function setPrimaryIdentifier($id)
    {
        $this->id = (int) $id;
    }


    /** * Helper function returns total count of the passed query builder * * @param Query<Order> $dataQuery */
    private function getStatisticListTotalCount(Query $dataQuery): ?int
    {
        // userCurrencyFactor has not to be part of the count parameters         $originalParameters = $dataQuery->getParameters();
        $countParameters = new ArrayCollection();

        /** @var Parameter $parameter */
        foreach ($originalParameters as $parameter) {
            if ($parameter->getName() === 'userCurrencyFactor') {
                continue;
            }

            $countParameters->add($parameter);
        }

        $dataQuery->setParameters($countParameters);
        
/** * Private var that holds the max position value of the form fields * The value is kept up to date on a "best effort" policy * * @var int|null */
    private $maxFieldPositionValue;

    public function __construct()
    {
        $this->fields = new ArrayCollection();
    }

    /** * Contains all the assigned \Shopware\Models\Emotion\Library\Field models. * Each component has a field configuration to configure the component data over the * backend module. For example: The "Article" component has an "id" field * with xtype: 'emotion-article-search' (the shopware article suggest search with a individual configuration for the * backend module) to configure which article has to been displayed. * * @return ArrayCollection<array-key, Field> */
    

    protected $documents;

    public function __construct()
    {
        $this->recipients = new ArrayCollection();
        $this->documents = new ArrayCollection();
    }

    public function getId(): ?int
    {
        return $this->id;
    }

    public function setId(int $id): void
    {
        $this->id = $id;
    }

    public function addParameters(array $parameters)
    {
        trigger_error(sprintf('%s::%s() is deprecated. Please use addParameter().', __CLASS__, __METHOD__), E_USER_DEPRECATED);

        $existingParameters = $this->getParameters();
        $newParameters = new ArrayCollection();

        foreach ($existingParameters as $existingParameter) {
            if (!isset($parameters[$existingParameter->getName()])) {
                $newParameters->add($existingParameter);
            }
        }

        foreach ($parameters as $key => $value) {
            $parameter = new Parameter($key$value);
            $newParameters->add($parameter);
        }

        

    private function getConfig(Template $template, Shop $shop): array
    {
        $config = $this->inheritance->buildConfig($template$shop);
        $config['shopware-revision'] = md5($this->release->getRevision() . $this->uniqueIdGenerator->getUniqueId());

        /** @var ArrayCollection<int, mixed> $collection */
        $collection = new ArrayCollection();

        $this->eventManager->collect(
            'Theme_Compiler_Collect_Less_Config',
            $collection,
            ['shop' => $shop, 'template' => $template]
        );

        foreach ($collection as $temp) {
            if (!\is_array($temp)) {
                throw new Exception("The passed plugin less config isn't an array!");
            }
            
/** * @var bool * * @ORM\Column(name="in_safe_mode", type="boolean") */
    private $inSafeMode = false;

    public function __construct()
    {
        $this->added = new DateTime('now');
        $this->emotionComponents = new ArrayCollection();
        $this->configForms = new ArrayCollection();
        $this->menuItems = new ArrayCollection();
        $this->payments = new ArrayCollection();
        $this->templates = new ArrayCollection();
        $this->licenses = new ArrayCollection();
        $this->widgets = new ArrayCollection();
    }

    public function setId(int $id): void
    {
        $this->id = $id;
    }
$output->writeln($formatter->formatBlock('WARNING! ' . $e->getMessage() . ' in ' . $e->getFile(), 'error'));
            }
        }
    }

    protected function registerEventCommands()
    {
        $this->kernel->getContainer()->load('plugins');

        $eventManager = $this->kernel->getContainer()->get('events');

        $collection = new ArrayCollection();
        $collection = $eventManager->collect('Shopware_Console_Add_Command', $collection['subject' => $this]);

        foreach ($collection as $command) {
            if ($command instanceof Command) {
                $this->add($command);
            }

            if ($command instanceof ContainerAwareInterface) {
                $command->setContainer($this->getKernel()->getContainer());
            }
        }
    }
if ($synchronizer->supports() === $shopIndex->getType()) {
                $synchronizer->synchronize($shopIndex$backlogs);
            }
        }
    }

    /** * @return SynchronizerInterface[] */
    private function collectSynchronizer(): array
    {
        $collection = new ArrayCollection();
        $this->eventManager->collect(
            'Shopware_ESIndexingBundle_Collect_Synchronizer',
            $collection
        );

        return array_merge($collection->toArray()$this->synchronizers);
    }

    /** * @param Backlog[] $backlogs */
    
private $releaseDate;

    /** * @var string|null * * @ORM\Column(name="shippingtime", type="string", length=11, nullable=true) */
    private $shippingTime;

    public function __construct()
    {
        $this->prices = new ArrayCollection();
        $this->images = new ArrayCollection();
        $this->configuratorOptions = new ArrayCollection();
        $this->notifications = new ArrayCollection();
        $this->attribute = new ProductAttribute();
        $this->attribute->setArticleDetail($this);
    }

    /** * @return int */
    public function getId()
    {
        $payments = $params['payments'] ?? [];
        $holidays = $params['holidays'] ?? [];
        $countries = $params['countries'] ?? [];
        $categories = $params['categories'] ?? [];

        if (!isset($params['shippingFree']) || $params['shippingFree'] === '' || $params['shippingFree'] === '0') {
            $params['shippingFree'] = null;
        } else {
            $params['shippingFree'] = (float) str_replace(',', '.', $params['shippingFree']);
        }

        $params['payments'] = new ArrayCollection();
        $params['holidays'] = new ArrayCollection();
        $params['countries'] = new ArrayCollection();
        $params['categories'] = new ArrayCollection();

        $params['multiShopId'] = $this->cleanData($params['multiShopId']);
        $params['customerGroupId'] = $this->cleanData($params['customerGroupId']);
        $params['bindTimeFrom'] = $this->cleanData($params['bindTimeFrom']);
        $params['bindTimeTo'] = $this->cleanData($params['bindTimeTo']);
        $params['bindInStock'] = $this->cleanData($params['bindInStock'] ?? null);
        $params['bindWeekdayFrom'] = $this->cleanData($params['bindWeekdayFrom']);
        $params['bindWeekdayTo'] = $this->cleanData($params['bindWeekdayTo']);
        

    private $privileges;

    /** * Initials the privileges collection */
    public function __construct()
    {
        $this->privileges = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /** * @return int */
    public function getId()
    {
        return $this->id;
    }

    /** * @param string $name * * @return \Shopware\Models\User\Resource */

    private $created;

    /** * @param string $resource */
    public function __construct($resource)
    {
        $this->resource = $resource;
        $this->articleDetails = new ArrayCollection();
    }

    public function setCreated(?DateTimeInterface $created)
    {
        $this->created = $created;
    }

    /** * @return DateTimeInterface|null */
    public function getCreated()
    {
Home | Imprint | This part of the site doesn't use cookies.