本文整理汇总了PHP中Component::getComponent方法的典型用法代码示例。如果您正苦于以下问题:PHP Component::getComponent方法的具体用法?PHP Component::getComponent怎么用?PHP Component::getComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Component
的用法示例。
在下文中一共展示了Component::getComponent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSelect
function getSelect($id, $event, $function, array $option, $name)
{
$this->event = $event;
$this->select = parent::getComponent($id, $event, $function, $name) . " ><option id=0 >--Seleccionar--</option>";
foreach ($option as $key => $value) {
$this->select .= "<option>" . $value . "</option>";
}
return $this->select . "</select>";
}
示例2: flush
/**
*
* @param Component $component
* @return int id of the Component inserted in base. False if it didn't work.
*/
public static function flush($component)
{
$componentId = $component->getId();
$mark = $component->getMark();
$date = $component->getDate();
$isResit = $component->getIsResit();
$user = $component->getUser()->getId();
$componentLinked = $component->getComponent()->getId();
$module = $component->getModule()->getId();
$type = $component->getType()->getId();
if ($componentId > 0) {
$sql = 'UPDATE component c SET ' . 'c.mark = ?, ' . 'c.date = ?, ' . 'c.is_resit = ?, ' . 'c.USER_id_user = ?, ' . 'c.COMPONENT_id_component = ?, ' . 'c.MODULE_id_module = ?, ' . 'c.TYPE_id_type= ? ' . 'WHERE c.id_component = ?';
$params = array('dsiiiiii', &$mark, &$date, &$isResit, &$user, &$componentLinked, &$module, &$type, &$componentId);
} else {
$sql = 'INSERT INTO component ' . '(mark, date, is_resit, ' . 'USER_id_user, COMPONENT_id_component, MODULE_id_module, TYPE_id_type ) ' . 'VALUES(?, ?, ?, ?, ?, ?, ?) ';
$params = array('dsiiiii', &$mark, &$date, &$isResit, &$user, &$componentLinked, &$module, &$type);
}
$idInsert = BaseSingleton::insertOrEdit($sql, $params);
if ($idInsert !== false && $componentId > 0) {
$idInsert = $componentId;
}
return $idInsert;
}