@@ -20,19 +20,6 @@ class OpenStackComponent extends DataObject implements IOpenStackComponent
2020
2121 use SluggableEntity;
2222
23- // IMPORTANT : this fixes the order for categories on software page
24- public static $ categories = array (
25- "Compute " ,
26- "Storage, Backup & Recovery " ,
27- "Networking & Content Delivery " ,
28- "Data & Analytics " ,
29- "Security, Identity & Compliance " ,
30- "Management Tools " ,
31- "Deployment Tools " ,
32- "Application Services " ,
33- "None "
34- );
35-
3623 static $ db = array
3724 (
3825 'Name ' => 'Varchar(255) ' ,
@@ -41,37 +28,38 @@ class OpenStackComponent extends DataObject implements IOpenStackComponent
4128 'SupportsVersioning ' => 'Boolean ' ,
4229 'SupportsExtensions ' => 'Boolean ' ,
4330 'IsCoreService ' => 'Boolean ' ,
44- 'Use ' => 'Enum(array("Application Services","Compute","Data & Analytics","Deployment Tools","Management Tools","Monitoring & Metering","Networking & Content Delivery","Security, Identity & Compliance","Storage, Backup & Recovery","None"), "None") ' ,
45- 'HasStableBranches ' => 'Boolean ' ,
4631 'WikiUrl ' => 'Text ' ,
47- 'TCApprovedRelease ' => 'Boolean ' ,
48- 'HasTeamDiversity ' => 'Boolean ' ,
49- 'IncludedComputeStarterKit ' => 'Boolean ' ,
50- 'VulnerabilityManaged ' => 'Boolean ' ,
5132 'Order ' => 'Int ' ,
5233 'YouTubeID ' => 'Varchar ' ,
5334 'VideoDescription ' => 'Text ' ,
5435 'VideoTitle ' => 'Varchar ' ,
55- 'FollowsStandardDeprecation ' => 'Boolean ' ,
56- 'SupportsUpgrade ' => 'Boolean ' ,
57- 'SupportsRollingUpgrade ' => 'Boolean ' ,
5836 'ShowOnMarketplace ' => 'Boolean(1) ' ,
5937 'Slug ' => 'Varchar(255) '
6038 );
6139
6240 static $ has_one = array
6341 (
64- "LatestReleasePTL " => "Member " ,
65- "Mascot " => "Mascot "
42+ "LatestReleasePTL " => "Member " ,
43+ "Mascot " => "Mascot " ,
44+ "SubCategory " => "OpenStackComponentSubCategory "
6645 );
6746
6847 static $ has_many = array
6948 (
70- 'Versions ' => 'OpenStackApiVersion ' ,
71- 'RelatedContent ' => 'OpenStackComponentRelatedContent ' ,
72- 'Caveats ' => 'OpenStackComponentReleaseCaveat ' ,
49+ 'Versions ' => 'OpenStackApiVersion ' ,
50+ 'RelatedContent ' => 'OpenStackComponentRelatedContent ' ,
51+ 'Caveats ' => 'OpenStackComponentReleaseCaveat '
52+ );
53+
54+ static $ many_many = array
55+ (
56+ 'Tags ' => 'OpenStackComponentTag '
7357 );
7458
59+ private static $ many_many_extraFields = array
60+ (
61+ 'Tags ' => array ( 'SortOrder ' => 'Int ' )
62+ );
7563
7664 static $ belongs_many_many = array
7765 (
@@ -299,4 +287,29 @@ public function getCaveatsForReleaseType($release_id, $type)
299287 )
300288 );
301289 }
290+
291+ /**
292+ * @param IOpenStackComponentTag $new_tag
293+ * @return void
294+ */
295+ public function addTag (IOpenStackComponentTag $ new_tag )
296+ {
297+ AssociationFactory::getInstance ()->getMany2ManyAssociation ($ this , 'Tags ' )->add ($ new_tag );
298+ }
299+
300+ /**
301+ * @return IOpenStackComponentTag[]
302+ */
303+ public function getMaturityTags ()
304+ {
305+ return $ this ->Tags ()->filter ('Type ' , 'maturity ' );
306+ }
307+
308+ /**
309+ * @return IOpenStackComponentTag[]
310+ */
311+ public function getInfoTags ()
312+ {
313+ return $ this ->Tags ()->filter ('Type ' , 'info ' );
314+ }
302315}
0 commit comments