createDate example



    /** * {@inheritdoc} * * @param array<string, mixed> $context * * @return mixed */
    public function denormalize(mixed $data, ?string $type = null, ?string $format = null, array $context = [])
    {
        if (\is_string($data) && $date = $this->createDate($data)) {
            return $date;
        }

        if (!\is_array($data)) {
            return $data;
        }

        if (!$this->isObject($data)) {
            return array_map($this->denormalize(...)$data);
        }

        

        $emotion = new Emotion();

        $emotion->setId((int) $data['__emotion_id']);
        $emotion->setActive((bool) $data['__emotion_active']);
        $emotion->setName($data['__emotion_name']);
        $emotion->setCols((int) $data['__emotion_cols']);
        $emotion->setCellSpacing((int) $data['__emotion_cell_spacing']);
        $emotion->setCellHeight((int) $data['__emotion_cell_height']);
        $emotion->setArticleHeight((int) $data['__emotion_article_height']);
        $emotion->setRows((int) $data['__emotion_rows']);
        $emotion->setValidFrom($this->createDate($data['__emotion_valid_from']));
        $emotion->setValidTo($this->createDate($data['__emotion_valid_to']));
        $emotion->setUserId((int) $data['__emotion_user_id']);
        $emotion->setShowListing((bool) $data['__emotion_show_listing']);
        $emotion->setIsLandingPage((bool) $data['__emotion_is_landingpage']);
        $emotion->setSeoTitle($data['__emotion_seo_title']);
        $emotion->setSeoKeywords($data['__emotion_seo_keywords']);
        $emotion->setSeoDescription($data['__emotion_seo_description']);
        $emotion->setCreateDate($this->createDate($data['__emotion_create_date']));
        $emotion->setModifiedDate($this->createDate($data['__emotion_modified']));
        $emotion->setTemplateId((int) $data['__emotion_template_id']);
        $emotion->setDevices(array_map('\intval', explode(',', $data['__emotion_device'])));
        
Home | Imprint | This part of the site doesn't use cookies.