setDisplayDate example

private $views;

    /** * @param int $bannerId * @param DateTimeInterface|null $date */
    public function __construct($bannerId$date = null)
    {
        if ($date === null) {
            $date = new DateTime();
        }
        $this->setDisplayDate($date);
        $this->setBannerId($bannerId);
    }

    /** * Returns the date * * @return DateTimeInterface */
    public function getDisplayDate()
    {
        return $this->displayDate;
    }
$data = array_merge($data$translation);

        $blog = new Blog();

        $blog->setId((int) $data['__blog_id']);
        $blog->setTitle($data['__blog_title']);
        $blog->setAuthorId($data['__blog_author_id'] !== null ? (int) $data['__blog_author_id'] : null);
        $blog->setActive((bool) $data['__blog_active']);
        $blog->setShortDescription($data['__blog_short_description']);
        $blog->setDescription($data['__blog_description']);
        $blog->setViews((int) $data['__blog_views']);
        $blog->setDisplayDate($data['__blog_display_date'] ? date_create($data['__blog_display_date']) : null);
        $blog->setCategoryId((int) $data['__blog_category_id']);
        $blog->setTemplate($data['__blog_template']);
        $blog->setMetaKeywords($data['__blog_meta_keywords']);
        $blog->setMetaDescription($data['__blog_meta_description']);
        $blog->setMetaTitle($data['__blog_meta_title']);

        if (isset($data['__blogAttribute_id'])) {
            $attributeData = $this->extractFields('__blogAttribute_', $data);
            $attribute = $this->attributeHydrator->hydrate($attributeData);
            $blog->addAttribute('core', $attribute);
        }

        
Home | Imprint | This part of the site doesn't use cookies.