"name"]); } public static function getOptions(): array { $options = []; foreach(self::getAll() as $customer) { $options[$customer->id] = $customer->name; } return $options; } // Object methods /** * @return Address * @throws \Exception */ public function getAddress(): Address { $address = Address::get($this->address_id); return $address ?: new Address(); } public function getSlug(): string { return Util::slug("$this->name $this->id"); } public function getUrl(): string { return sprintf("/customers/%s", $this->getSlug()); } /** * @return Location[] */ public function getLocations(): array { return Location::query(["customer_id" => $this->id, "dts_deleted" => null]); } }