created = new \DateTimeImmutable('now'); } /** * Get id. * * @return int * * @since 1.0.0 */ public function getId() : int { return $this->id; } /** * Get posting. * * @param int $id Posting ID * * @return null|PostingInterface * * @since 1.0.0 */ public function getPosting(int $id) : ?PostingInterface { return $this->postings[$id] ?? null; } /** * Remove posting. * * @param int $id Posting ID * * @return bool * * @since 1.0.0 */ public function removePosting($id) : bool { if (!isset($this->postings[$id])) { return false; } unset($this->postings[$id]); return true; } /** * Add posting. * * @param PostingInterface $posting Posting * * @return void * * @since 1.0.0 */ public function addPosting(PostingInterface $posting) : void { $this->postings[] = $posting; } /** * {@inheritdoc} */ public function count() : int { return \count($this->postings); } }