Fakoli Framework
InclusionFilter Class Reference

Used to place a filter on the contents of a DataItem-derived object. More...

Public Member Functions

 InclusionFilter ()
 
 isExcluded ($field)
 
 add ()
 
 remove ()
 
 includeField ($field)
 
 excludeField ($field)
 

Public Attributes

 $fields = array()
 
 $type = "InclusionFilter"
 

Detailed Description

Used to place a filter on the contents of a DataItem-derived object.

With an InclusionFilter, only the specified fields (and the primary key) will be included in any subsequent queries or operations.

Definition at line 100 of file abstract_data_item.inc.

Member Function Documentation

◆ add()

InclusionFilter::add ( )

Definition at line 119 of file abstract_data_item.inc.

120  {
121  $args = func_get_args();
122  for($i = 0; $i < count($args); ++$i)
123  {
124  $this->fields[$args[$i]] = true;
125  }
126  }

◆ excludeField()

InclusionFilter::excludeField (   $field)

Definition at line 142 of file abstract_data_item.inc.

143  {
144  $this->remove($field);
145  }

◆ includeField()

InclusionFilter::includeField (   $field)

Definition at line 137 of file abstract_data_item.inc.

138  {
139  $this->add($field);
140  }

◆ InclusionFilter()

InclusionFilter::InclusionFilter ( )

Definition at line 105 of file abstract_data_item.inc.

106  {
107  $args = func_get_args();
108  for($i = 0; $i < count($args); ++$i)
109  {
110  $this->fields[$args[$i]] = true;
111  }
112  }

◆ isExcluded()

InclusionFilter::isExcluded (   $field)

Definition at line 114 of file abstract_data_item.inc.

115  {
116  return !(array_key_exists($field, $this->fields));
117  }

◆ remove()

InclusionFilter::remove ( )

Definition at line 128 of file abstract_data_item.inc.

129  {
130  $args = func_get_args();
131  for($i = 0; $i < count($args); ++$i)
132  {
133  unset($this->fields[$args[$i]]);
134  }
135  }

Member Data Documentation

◆ $fields

InclusionFilter::$fields = array()

Definition at line 102 of file abstract_data_item.inc.

◆ $type

InclusionFilter::$type = "InclusionFilter"

Definition at line 103 of file abstract_data_item.inc.


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