Get created at.

@param Description $description The venue details description.

@return \DateTimeImmutable|null
193712
private function getCreatedAt(Description $description)
    {
        $createdAt = $description->getOptionalProperty('createdAt');

        return ($createdAt !== null) ? (new \DateTimeImmutable())->setTimestamp($createdAt) : null;
    }
446044
public function endGroup($description) {
        $groupStarts = $this->getGroupStarts();
        if(!array_key_exists($description, $groupStarts)) {
            throw new \Exception('No start group was specified for: ' . $description);
        }
        $time = microtime(true);
        $difference = $time - $groupStarts[$description];
        $groupTotals = $this->getGroupTotals();
        if(!array_key_exists($description, $groupTotals)) {
            $groupTotals[$description] = 0;
        }
        $groupTotals[$description] += $difference;
        $this->setGroupTotals($groupTotals);
    }
499259
private function getCoordinates(Description $description)
    {
        $latitude  = $description->getOptionalProperty('lat');
        $longitude = $description->getOptionalProperty('lng');

        if ($latitude === null || $longitude === null) {
            return null;
        }

        return new Coordinates($latitude, $longitude);
    }
951233
private function setDescription($description = null)
    {
        if (isset($description) && ! is_string($description)) {
            throw new InvalidArgumentException("Description must be a string. [$description] given.");
        }

        $this->description = $description;
    }
604651
public function create(Description $description)
    {
        return new TipGroup(
            $description->getMandatoryProperty('name'),
            $description->getMandatoryProperty('type'),
            $this->getTips($description)
        );
    }
912143
private function getCategories(Description $description)
    {
        return array_map(
            function (\stdClass $categoryDescription) {
                return $this->categoryFactory->create(new Description($categoryDescription));
            },
            $description->getOptionalProperty('categories', [])
        );
    }
181310
public function setPermission($name, $description = null)
    {
        $permission = $this->getPermission($name) ?: $this->createPermission($name);
        if ($description) {
            $permission->description = $description;
        }
        $this->add($permission);

        return $permission;
    }
1206927
private function createDescriptor(string $name, string $description): void
    {
        $version = $this->getVersion();
        $this->descriptor = new Descriptor($name, $description, $version);
    }
335504
public function setCreated(\DateTime $created = null)
    {
        $this->_created = null === $created ? new \DateTime() : $created;

        return $this->getContentInstance();
    }
16385
private function getPhotos(Description $description)
    {
        return array_map(
            function (\stdClass $photoDescription) {
                return $this->photoFactory->create(new Description($photoDescription));
            },
            $description->getOptionalProperty('items', [])
        );
    }
195766
public function field(string $key, $value = null, $description = null)
    {
        if ( ! $field = $this->fields->where('key', $key)->first()) {
            $this->fields->push(
                $field = $this->fields()->firstOrNew(compact('key'))
            );
        }

        $field->setDefaultValue($value);
        $field->setDefaultDescription($description);

        $field->save();

        return $field;
    }
1308292
public function getCreatedAt($format = 'Y-m-d H:i:s')
    {
        if ($this->createdAt instanceof \DateTime && $format !== null) {
            return $this->createdAt->format($format);
        }

        return $this->createdAt;
    }
927877
public function setDescription($description)
    {
        $this->content = null;
        $this->parsedDescription = null;
        $this->description = trim($description);

        return $this;
    }
1154366
public function prepareDescriptionForPersist($description)
    {
        $description = html_entity_decode($description);
        $description = strip_tags($description);
        $description = filter_var($description, FILTER_SANITIZE_STRING);

        // remove the encoded blank chars
        $description = str_replace("\xc2\xa0",'',$description);

        $description = trim($description);
        return $description;
    }
927064
public function createDateTime($value)
    {
        $date = null;

        if(is_string($value)) {
            $date = new \DateTime($value);
        }

        if(is_int($value)) {
            $date = new \DateTime();
            $date->setTimestamp($value);
        }

        return $date;
    }
961762
public static function build($location, $required, $description)
    {
        $param = new static();
        $param->location = $location;
        $param->required = $required;
        $param->description = $description;

        return $param;
    }
925582
public function setDescription($description)
    {
        self::writeFullTag(
            $description,
            'description',
            false,
            'media:description',
            $this->validator,
            'validateDescription',
            $this->exception,
            'Provided description is not a valid value.'
        );

        return $this;
    }