company.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. class Company {
  3. private $name;
  4. private $address;
  5. private $city;
  6. private $postal_code;
  7. private $country;
  8. private $phone;
  9. private $email;
  10. private $y_tunnus;
  11. public function __construct() {
  12. $this->name = getenv('COMPANY_NAME') ?: 'Inventory Management System';
  13. $this->address = getenv('COMPANY_ADDRESS') ?: '123 Business Street';
  14. $this->city = getenv('COMPANY_CITY') ?: 'Helsinki';
  15. $this->postal_code = getenv('COMPANY_POSTAL_CODE') ?: '00100';
  16. $this->country = getenv('COMPANY_COUNTRY') ?: 'Finland';
  17. $this->phone = getenv('COMPANY_PHONE') ?: '+358 123 456 789';
  18. $this->email = getenv('COMPANY_EMAIL') ?: 'info@company.com';
  19. $this->y_tunnus = getenv('COMPANY_Y_TUNNUS') ?: '1234567-8';
  20. }
  21. public function getDetails() {
  22. return [
  23. 'name' => $this->name,
  24. 'address' => $this->address,
  25. 'city' => $this->city,
  26. 'postal_code' => $this->postal_code,
  27. 'country' => $this->country,
  28. 'phone' => $this->phone,
  29. 'email' => $this->email,
  30. 'y_tunnus' => $this->y_tunnus,
  31. 'full_address' => $this->address . ', ' . $this->postal_code . ' ' . $this->city . ', ' . $this->country,
  32. 'contact_info' => $this->phone . ' | ' . $this->email
  33. ];
  34. }
  35. public function getName() { return $this->name; }
  36. public function getAddress() { return $this->address; }
  37. public function getCity() { return $this->city; }
  38. public function getPostalCode() { return $this->postal_code; }
  39. public function getCountry() { return $this->country; }
  40. public function getPhone() { return $this->phone; }
  41. public function getEmail() { return $this->email; }
  42. public function getYTunnus() { return $this->y_tunnus; }
  43. }
  44. ?>