public function setDefaults($type = false)
    {
        if (!$type) {
            if (!$this->has('content_type_slug') && !$this->has('id')) {
                throw new FatalErrorException(__d('content', 'Unable to get Content-Type information.'));
            }

            if (!$this->has('content_type_slug')) {
                $contentTypeSlug = TableRegistry::get('Content.Contents')->find()
                    ->select(['content_type_slug'])
                    ->where(['id' => $this->get('id')])
                    ->first();
                $contentTypeSlug = $contentTypeSlug->content_type_slug;
            } else {
                $contentTypeSlug = $this->get('content_type_slug');
            }

            $type = TableRegistry::get('Content.ContentTypes')->find()
                ->where(['slug' => $contentTypeSlug])
                ->first();
        }

        if (!($type instanceof ContentType) || !$type->has('defaults')) {
            throw new FatalErrorException(__d('content', "Content::setDefaults() was unable to get Content Type defaults values."));
        }

        $this->set('language', $type->defaults['language']);
        $this->set('comment_status', $type->defaults['comment_status']);
        $this->set('status', $type->defaults['status']);
        $this->set('promote', $type->defaults['promote']);
        $this->set('sticky', $type->defaults['sticky']);
    }