本文整理汇总了PHP中ActiveRecord::getArFieldList方法的典型用法代码示例。如果您正苦于以下问题:PHP ActiveRecord::getArFieldList方法的具体用法?PHP ActiveRecord::getArFieldList怎么用?PHP ActiveRecord::getArFieldList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActiveRecord
的用法示例。
在下文中一共展示了ActiveRecord::getArFieldList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateFields
/**
* @return bool
*/
protected function generateFields()
{
$fields = $this->active_record->getArFieldList()->getFields();
foreach ($fields as $standard_field) {
$current_class = get_called_class();
$field_class = $current_class::FIELD_CLASS;
/**
* @var arViewField $field_class
*/
$field = $field_class::castFromFieldToViewField($standard_field);
$this->addField($field);
}
return true;
}
示例2: asSQLStatement
/**
* @description Build WHERE Statement
*
* @param ActiveRecord $ar
*
* @throws arException
* @return string
*/
public function asSQLStatement(ActiveRecord $ar)
{
if ($this->getType() == self::TYPE_REGULAR) {
$arField = $ar->getArFieldList()->getFieldByName($this->getFieldname());
if ($arField instanceof arField) {
$type = $arField->getFieldType();
$statement = $ar->getConnectorContainerName() . '.' . $this->getFieldname();
} else {
$statement = $this->getFieldname();
}
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);
}
$this->setStatement($statement);
}
return $this->getStatement();
}
示例3: updateDatabase
/**
* @param ActiveRecord $ar
*
* @return bool
*/
public function updateDatabase(ActiveRecord $ar)
{
$ilDB = $this->returnDB();
foreach ($ar->getArFieldList()->getFields() as $field) {
if (!$ilDB->tableColumnExists($ar->getConnectorContainerName(), $field->getName())) {
$ilDB->addTableColumn($ar->getConnectorContainerName(), $field->getName(), $field->getAttributesForConnector());
}
}
return true;
}