getCreated example

$queue->setOperations(json_encode($operations));
            $queue->setCreated(new DateTime());
            $queue->setActive(false);
            $queue->setInitialSize($totalCount);

            $entityManager->persist($queue);
            $entityManager->flush();

            $queueId = $queue->getId();
        }

        $this->getBackupResource()->create($results$operations$newBackup$queue->getCreated() ? $queue->getCreated()->getTimestamp() : time());

        // Tested this with ~140k products - compared with pure SQL this is reasonable fast         // In most cases the filter query will be the bottleneck         $i = 0;
        $model = null;
        foreach ($results as $detailId) {
            // Flush after 20 entities             if (($i++ % 20) === 0) {
                $entityManager->flush($model);
                $entityManager->clear();

                
$this->bag = new MetadataBag();
        $this->array = [MetadataBag::CREATED => 1234567, MetadataBag::UPDATED => 12345678, MetadataBag::LIFETIME => 0];
        $this->bag->initialize($this->array);
    }

    public function testInitialize()
    {
        $sessionMetadata = [];

        $bag1 = new MetadataBag();
        $bag1->initialize($sessionMetadata);
        $this->assertGreaterThanOrEqual(time()$bag1->getCreated());
        $this->assertEquals($bag1->getCreated()$bag1->getLastUsed());

        sleep(1);
        $bag2 = new MetadataBag();
        $bag2->initialize($sessionMetadata);
        $this->assertEquals($bag1->getCreated()$bag2->getCreated());
        $this->assertEquals($bag1->getLastUsed()$bag2->getLastUsed());
        $this->assertEquals($bag2->getCreated()$bag2->getLastUsed());

        sleep(1);
        $bag3 = new MetadataBag();
        
/** * Returns the creation date of the media. * * @return DateTimeInterface|null */
    public function getCreated()
    {
        if (!$this->getMedia() instanceof \Shopware\Models\Media\Media) {
            return null;
        }

        return $this->getMedia()->getCreated();
    }

    /** * Returns the id of the user, who uploaded the file. * * @return int|null */
    public function getUserId()
    {
        if (!$this->getMedia() instanceof \Shopware\Models\Media\Media) {
            return null;
        }

        }

        $content = $request->getContent();

        $sessionMetadata = [];
        $sessionAttributes = [];
        $flashes = [];
        if ($request->hasSession()) {
            $session = $request->getSession();
            if ($session->isStarted()) {
                $sessionMetadata['Created'] = date(\DATE_RFC822, $session->getMetadataBag()->getCreated());
                $sessionMetadata['Last used'] = date(\DATE_RFC822, $session->getMetadataBag()->getLastUsed());
                $sessionMetadata['Lifetime'] = $session->getMetadataBag()->getLifetime();
                $sessionAttributes = $session->all();
                $flashes = $session->getFlashBag()->peekAll();
            }
        }

        $statusCode = $response->getStatusCode();

        $responseCookies = [];
        foreach ($response->headers->getCookies() as $cookie) {
            

        }

        $content = $request->getContent();

        $sessionMetadata = [];
        $sessionAttributes = [];
        $flashes = [];
        if ($request->hasSession()) {
            $session = $request->getSession();
            if ($session->isStarted()) {
                $sessionMetadata['Created'] = date(\DATE_RFC822, $session->getMetadataBag()->getCreated());
                $sessionMetadata['Last used'] = date(\DATE_RFC822, $session->getMetadataBag()->getLastUsed());
                $sessionMetadata['Lifetime'] = $session->getMetadataBag()->getLifetime();
                $sessionAttributes = $session->all();
                $flashes = $session->getFlashBag()->peekAll();
            }
        }

        $statusCode = $response->getStatusCode();

        $responseCookies = [];
        foreach ($response->headers->getCookies() as $cookie) {
            
Home | Imprint | This part of the site doesn't use cookies.