ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
arWhere Class Reference

Class arWhere. More...

+ Inheritance diagram for arWhere:
+ Collaboration diagram for arWhere:

Public Member Functions

 asSQLStatement (ActiveRecord $ar)
 Build WHERE Statement
 setFieldname ($fieldname)
 getFieldname ()
 setOperator ($operator)
 getOperator ()
 setValue ($value)
 getValue ()
 setType ($type)
 getType ()
 setStatement ($statement)
 getStatement ()
 setLink ($link)
 getLink ()
- Public Member Functions inherited from arStatement
 getTableNameAs ()
 setTableNameAs ($table_name_as)

Data Fields

const TYPE_STRING = 1
const TYPE_REGULAR = 2

Protected Attributes

 $type = self::TYPE_REGULAR
 $fieldname = ''
 $value
 $operator= '='
 $statement = ''
 $link = 'AND'
- Protected Attributes inherited from arStatement
 $table_name_as = ''

Detailed Description

Class arWhere.

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Version
2.0.7

Definition at line 10 of file class.arWhere.php.

Member Function Documentation

arWhere::asSQLStatement ( ActiveRecord  $ar)

Build WHERE Statement

Parameters
ActiveRecord$ar
Exceptions
arException
Returns
string

Reimplemented from arStatement.

Definition at line 48 of file class.arWhere.php.

References $statement, $type, $value, ActiveRecord\getArConnector(), ActiveRecord\getArFieldList(), ActiveRecord\getConnectorContainerName(), getFieldname(), getOperator(), getStatement(), getType(), getValue(), setOperator(), and setStatement().

{
if ($this->getType() == self::TYPE_REGULAR) {
$arField = $ar->getArFieldList()->getFieldByName($this->getFieldname());
if ($arField instanceof arField) {
$type = $arField->getFieldType();
} else {
}
if (is_array($this->getValue())) {
if (in_array($this->getOperator(), array( 'IN', 'NOT IN', 'NOTIN' ))) {
$statement .= ' ' . $this->getOperator() . ' (';
} else {
$statement .= ' IN (';
}
$values = array();
foreach ($this->getValue() as $value) {
$values[] = $ar->getArConnector()->quote($value, $type);
}
$statement .= implode(', ', $values);
$statement .= ')';
} else {
if ($this->getValue() === NULL) {
$this->setOperator('IS');
}
$statement .= ' ' . $this->getOperator();
$statement .= ' ' . $ar->getArConnector()->quote($this->getValue(), $type);
}
}
return $this->getStatement();
}

+ Here is the call graph for this function:

arWhere::getFieldname ( )
Returns
string

Definition at line 95 of file class.arWhere.php.

References $fieldname.

Referenced by asSQLStatement().

{
}

+ Here is the caller graph for this function:

arWhere::getLink ( )
Returns
string

Definition at line 175 of file class.arWhere.php.

References $link.

{
return $this->link;
}
arWhere::getOperator ( )
Returns
string

Definition at line 111 of file class.arWhere.php.

Referenced by asSQLStatement().

{
return $this->operator;
}

+ Here is the caller graph for this function:

arWhere::getStatement ( )
Returns
string

Definition at line 159 of file class.arWhere.php.

References $statement.

Referenced by asSQLStatement().

{
}

+ Here is the caller graph for this function:

arWhere::getType ( )
Returns
int

Definition at line 143 of file class.arWhere.php.

References $type.

Referenced by asSQLStatement().

{
return $this->type;
}

+ Here is the caller graph for this function:

arWhere::getValue ( )
Returns
mixed

Definition at line 127 of file class.arWhere.php.

References $value.

Referenced by asSQLStatement().

{
return $this->value;
}

+ Here is the caller graph for this function:

arWhere::setFieldname (   $fieldname)
Parameters
string$fieldname

Definition at line 87 of file class.arWhere.php.

References $fieldname.

{
$this->fieldname = $fieldname;
}
arWhere::setLink (   $link)
Parameters
string$link

Definition at line 167 of file class.arWhere.php.

References $link.

{
$this->link = $link;
}
arWhere::setOperator (   $operator)
Parameters
string$operator

Definition at line 103 of file class.arWhere.php.

Referenced by asSQLStatement().

{
$this->operator = $operator;
}

+ Here is the caller graph for this function:

arWhere::setStatement (   $statement)
Parameters
string$statement

Definition at line 151 of file class.arWhere.php.

References $statement.

Referenced by asSQLStatement().

{
$this->statement = $statement;
}

+ Here is the caller graph for this function:

arWhere::setType (   $type)
Parameters
int$type

Definition at line 135 of file class.arWhere.php.

References $type.

{
$this->type = $type;
}
arWhere::setValue (   $value)
Parameters
mixed$value

Definition at line 119 of file class.arWhere.php.

References $value.

{
$this->value = $value;
}

Field Documentation

arWhere::$fieldname = ''
protected

Definition at line 21 of file class.arWhere.php.

Referenced by getFieldname(), and setFieldname().

arWhere::$link = 'AND'
protected

Definition at line 37 of file class.arWhere.php.

Referenced by getLink(), and setLink().

arWhere::$operator= '='
protected

Definition at line 29 of file class.arWhere.php.

arWhere::$statement = ''
protected

Definition at line 33 of file class.arWhere.php.

Referenced by asSQLStatement(), getStatement(), and setStatement().

arWhere::$type = self::TYPE_REGULAR
protected

Definition at line 17 of file class.arWhere.php.

Referenced by asSQLStatement(), getType(), and setType().

arWhere::$value
protected

Definition at line 25 of file class.arWhere.php.

Referenced by asSQLStatement(), getValue(), and setValue().

const arWhere::TYPE_REGULAR = 2

Definition at line 13 of file class.arWhere.php.

const arWhere::TYPE_STRING = 1

Definition at line 12 of file class.arWhere.php.

Referenced by ActiveRecordList\where().


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