id = (int) $a['id']; $c->type = (string) $a['type']; $c->status = isset( $a['status'] ) ? (string) $a['status'] : 'publish'; $c->title = isset( $a['title'] ) ? (string) $a['title'] : ''; $c->authorId = isset( $a['authorId'] ) ? (int) $a['authorId'] : 0; $c->authorRegistered = isset( $a['authorRegistered'] ) ? (string) $a['authorRegistered'] : null; $c->postDate = isset( $a['postDate'] ) ? (string) $a['postDate'] : ''; $c->postModified = isset( $a['postModified'] ) ? (string) $a['postModified'] : ''; $c->content = isset( $a['content'] ) ? substr( (string) $a['content'], 0, Assumptions::CONTENT_MAX_BYTES ) : ''; return $c; } public function toArray(): array { return get_object_vars( $this ); } }