CMS  Version 3.9
Component Class Reference

Inherits DataItem.

Public Member Functions

 ComponentPages ()
 
 getPrettyName ()
 
 loadManifest ()
 

Static Public Member Functions

static formatOptions ()
 
static getComponent ($name)
 

Public Attributes

 $table = "component"
 
 $primary_key = "component_id"
 
 $default_format = "{getPrettyName()}"
 
 $fields
 
 $relations = array("ComponentPages" => ComponentPage)
 

Detailed Description

Definition at line 41 of file component.inc.

Member Function Documentation

◆ ComponentPages()

Component::ComponentPages ( )

Definition at line 61 of file component.inc.

62  {
63  $pages = Query::create(ComponentPage, "WHERE component=:i ORDER BY identifier")
64  ->bind(":i", $this->name)
65  ->execute();
66 
67  return $pages;
68  }
$pages
Definition: export.inc:38

◆ formatOptions()

static Component::formatOptions ( )
static

Definition at line 75 of file component.inc.

76  {
77  $options = array();
78 
79  $components = removeDuplicates(Query::create(Component, "ORDER BY name")->execute(), "name");
80  if(count($components) > 0)
81  {
82  foreach($components as $component)
83  {
84  $options[$component->name] = $component->name;
85  }
86  }
87 
88  return $options;
89  }
$component
Definition: help.inc:38
$components
Definition: tree.inc:41

◆ getComponent()

static Component::getComponent (   $name)
static

Definition at line 91 of file component.inc.

92  {
93  return Query::create(Component, "WHERE name=:n")->bind(":n", $name)->executeSingle();
94  }
$name
Definition: upload.inc:54

◆ getPrettyName()

Component::getPrettyName ( )

Definition at line 70 of file component.inc.

71  {
72  return prettify($this->name);
73  }

◆ loadManifest()

Component::loadManifest ( )

Definition at line 96 of file component.inc.

97  {
98  Fakoli::using($this->name);
99  $cl = Fakoli::getComponentClassRoot($this->name)."Manifest";
100  if (class_exists($cl))
101  {
102  return new $cl;
103  }
104  else
105  {
106  return null;
107  }
108  }
static using()
Import the datamodels, views and manifest for the specified component(s).
Definition: core.inc:116
static getComponentClassRoot($name)
Retrieves the capitalized camlCase name for the specified component.
Definition: core.inc:752

Member Data Documentation

◆ $default_format

Component::$default_format = "{getPrettyName()}"

Definition at line 45 of file component.inc.

◆ $fields

Component::$fields
Initial value:
= array("component_id" => Number,
"name" => String,
"version" => String,
"author" => String,
"description" => Text,
"priority" => Number,
"enabled" => Boolean,
"component_path" => String,
"last_modified" => Timestamp)

Definition at line 48 of file component.inc.

◆ $primary_key

Component::$primary_key = "component_id"

Definition at line 44 of file component.inc.

◆ $relations

Component::$relations = array("ComponentPages" => ComponentPage)

Definition at line 59 of file component.inc.

◆ $table

Component::$table = "component"

Definition at line 43 of file component.inc.


The documentation for this class was generated from the following file: