Skip to content

Commit 9712c05

Browse files
authored
feat: expose new service and company fields (#253)
Signed-off-by: romanetar <[email protected]>
1 parent 3529a68 commit 9712c05

14 files changed

+123
-1
lines changed

app/ModelSerializers/Companies/BaseCompanySerializer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class BaseCompanySerializer extends SilverStripeSerializer
2121
protected static $array_mappings = [
2222
'Name' => 'name:json_string',
2323
'Url' => 'url:json_string',
24+
'UrlSegment' => 'url_segment:json_string',
2425
'City' => 'city:json_string',
2526
'State' => 'state:json_string',
2627
'Country' => 'country:json_string',

app/ModelSerializers/Marketplace/CompanyServiceSerializer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ class CompanyServiceSerializer extends SilverStripeSerializer
2424
* @var array
2525
*/
2626
protected static $array_mappings = [
27+
'ClassName' => 'class_name:json_string',
2728
'Name' => 'name:json_string',
2829
'Overview' => 'overview:json_string',
2930
'Call2ActionUrl' => 'call_2_action_url:json_string',
31+
'Slug' => 'slug:json_string',
3032
'CompanyId' => 'company_id:json_int',
3133
'TypeId' => 'type_id:json_int',
3234
];

app/Models/Foundation/Main/Companies/Company.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,12 @@ class Company extends SilverstripeBaseModel
140140
*/
141141
private $is_deleted;
142142

143+
/**
144+
* @ORM\Column(name="URLSegment", type="string")
145+
* @var string
146+
*/
147+
private $url_segment;
148+
143149
// relations
144150

145151
/**
@@ -624,4 +630,18 @@ public function getProjectSponsorships(){
624630
public function getSponsorships(){
625631
return $this->sponsorships;
626632
}
633+
634+
/**
635+
* @return string
636+
*/
637+
public function getUrlSegment(): string{
638+
return $this->url_segment;
639+
}
640+
641+
/**
642+
* @param string $url_segment
643+
*/
644+
public function setUrlSegment(string $url_segment): void{
645+
$this->url_segment = $url_segment;
646+
}
627647
}

app/Models/Foundation/Marketplace/Appliance.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,13 @@
2020
*/
2121
class Appliance extends OpenStackImplementation
2222
{
23+
const ClassName = 'Appliance';
2324

25+
/**
26+
* @return string
27+
*/
28+
public function getClassName():string
29+
{
30+
return self::ClassName;
31+
}
2432
}

app/Models/Foundation/Marketplace/CloudService.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
*/
2222
class CloudService extends OpenStackImplementation
2323
{
24+
const ClassName = 'CloudService';
25+
2426
/**
2527
* @ORM\OneToMany(targetEntity="DataCenterLocation", mappedBy="cloud_service", cascade={"persist"}, orphanRemoval=true)
2628
* @var DataCenterLocation[]
@@ -41,6 +43,14 @@ public function __construct()
4143
$this->data_center_regions = new ArrayCollection();
4244
}
4345

46+
/**
47+
* @return string
48+
*/
49+
public function getClassName():string
50+
{
51+
return self::ClassName;
52+
}
53+
4454
/**
4555
* @return DataCenterLocation[]
4656
*/
@@ -56,5 +66,4 @@ public function getDataCenterRegions()
5666
{
5767
return $this->data_center_regions->toArray();
5868
}
59-
6069
}

app/Models/Foundation/Marketplace/CompanyService.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
*/
4141
class CompanyService extends SilverstripeBaseModel
4242
{
43+
const ClassName = 'CompanyService';
44+
4345
/**
4446
* @ORM\Column(name="Name", type="string")
4547
* @var string
@@ -114,6 +116,14 @@ public function __construct()
114116
$this->resources = new ArrayCollection();
115117
}
116118

119+
/**
120+
* @return string
121+
*/
122+
public function getClassName():string
123+
{
124+
return self::ClassName;
125+
}
126+
117127
/**
118128
* @return string
119129
*/

app/Models/Foundation/Marketplace/Consultant.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
*/
2323
class Consultant extends RegionalSupportedCompanyService
2424
{
25+
const ClassName = 'Consultant';
26+
2527
/**
2628
* @ORM\OneToMany(targetEntity="Office", mappedBy="consultant", cascade={"persist"}, orphanRemoval=true)
2729
* @var Office[]
@@ -83,6 +85,14 @@ public function __construct()
8385
$this->services_offered = new ArrayCollection();
8486
}
8587

88+
/**
89+
* @return string
90+
*/
91+
public function getClassName():string
92+
{
93+
return self::ClassName;
94+
}
95+
8696
/**
8797
* @return Office[]
8898
*/

app/Models/Foundation/Marketplace/Distribution.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,13 @@
2020
*/
2121
class Distribution extends OpenStackImplementation
2222
{
23+
const ClassName = 'Distribution';
2324

25+
/**
26+
* @return string
27+
*/
28+
public function getClassName():string
29+
{
30+
return self::ClassName;
31+
}
2432
}

app/Models/Foundation/Marketplace/OpenStackImplementation.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
*/
2525
class OpenStackImplementation extends RegionalSupportedCompanyService
2626
{
27+
const ClassName = 'OpenStackImplementation';
28+
2729
/**
2830
* @ORM\Column(name="CompatibleWithStorage", type="boolean")
2931
* @var bool
@@ -112,6 +114,14 @@ public function __construct()
112114
$this->capabilities = new ArrayCollection();
113115
}
114116

117+
/**
118+
* @return string
119+
*/
120+
public function getClassName():string
121+
{
122+
return self::ClassName;
123+
}
124+
115125
/**
116126
* @return bool
117127
*/

app/Models/Foundation/Marketplace/PrivateCloudService.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,13 @@
2020
*/
2121
class PrivateCloudService extends CloudService
2222
{
23+
const ClassName = 'PrivateCloudService';
2324

25+
/**
26+
* @return string
27+
*/
28+
public function getClassName():string
29+
{
30+
return self::ClassName;
31+
}
2432
}

app/Models/Foundation/Marketplace/PublicCloudService.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,13 @@
2020
*/
2121
class PublicCloudService extends CloudService
2222
{
23+
const ClassName = 'PublicCloudService';
2324

25+
/**
26+
* @return string
27+
*/
28+
public function getClassName():string
29+
{
30+
return self::ClassName;
31+
}
2432
}

app/Models/Foundation/Marketplace/RegionalSupportedCompanyService.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
*/
2424
class RegionalSupportedCompanyService extends CompanyService
2525
{
26+
const ClassName = 'RegionalSupportedCompanyService';
27+
2628
/**
2729
* @ORM\OneToMany(targetEntity="RegionalSupport", mappedBy="company_service", cascade={"persist"}, orphanRemoval=true)
2830
* @var RegionalSupport[]
@@ -35,6 +37,14 @@ public function __construct()
3537
$this->regional_supports = new ArrayCollection();
3638
}
3739

40+
/**
41+
* @return string
42+
*/
43+
public function getClassName():string
44+
{
45+
return self::ClassName;
46+
}
47+
3848
/**
3949
* @return RegionalSupport[]
4050
*/

app/Models/Foundation/Marketplace/RemoteCloudService.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
*/
2121
class RemoteCloudService extends OpenStackImplementation
2222
{
23+
const ClassName = 'RemoteCloudService';
24+
2325
/**
2426
* @ORM\Column(name="HardwareSpecifications", type="string")
2527
* @var string
@@ -44,6 +46,14 @@ class RemoteCloudService extends OpenStackImplementation
4446
*/
4547
private $vendor_managed_upgrades;
4648

49+
/**
50+
* @return string
51+
*/
52+
public function getClassName():string
53+
{
54+
return self::ClassName;
55+
}
56+
4757
/**
4858
* @return string
4959
*/

app/Models/Foundation/Marketplace/TrainingService.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,13 @@
2121
*/
2222
class TrainingService extends CompanyService
2323
{
24+
const ClassName = 'TrainingService';
2425

26+
/**
27+
* @return string
28+
*/
29+
public function getClassName():string
30+
{
31+
return self::ClassName;
32+
}
2533
}

0 commit comments

Comments
 (0)