code: public function checkCreatable()
      {
          if (property_exists($this, 'id') && $this->id > 0) {
              throw new \Exception(get_class($this) . " has ID:" . $this->id() . " thus not creatable.");
          }
  
      }
docs: Checks if this entity is creatable
  @throws \Exception