本文整理汇总了PHP中DynaformPeer::retrieveByPk方法的典型用法代码示例。如果您正苦于以下问题:PHP DynaformPeer::retrieveByPk方法的具体用法?PHP DynaformPeer::retrieveByPk怎么用?PHP DynaformPeer::retrieveByPk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DynaformPeer
的用法示例。
在下文中一共展示了DynaformPeer::retrieveByPk方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteLanguage
public function deleteLanguage($dyn_uid, $lang)
{
$con = Propel::getConnection(DynaformPeer::DATABASE_NAME);
$con->begin();
$oPro = DynaformPeer::retrieveByPk($dyn_uid);
$dyn_labels = \G::json_decode($oPro->getDynLabel());
unset($dyn_labels->{$lang});
$oPro->setDynLabel(G::json_encode($dyn_labels));
$oPro->save();
$con->commit();
}
示例2: dynaformExists
/**
* verify if Dynaform row specified in [DynUid] exists.
*
* @param string $sProUid the uid of the Prolication
*/
public function dynaformExists($DynUid)
{
$con = Propel::getConnection(TaskPeer::DATABASE_NAME);
try {
$oDyn = DynaformPeer::retrieveByPk($DynUid);
if (is_object($oDyn) && get_class($oDyn) == 'Dynaform') {
return true;
} else {
return false;
}
} catch (Exception $oError) {
throw $oError;
}
}
示例3: getConditionScript
public function getConditionScript($DYN_UID)
{
require_once 'classes/model/Dynaform.php';
G::LoadSystem('dynaformhandler');
$oDynaform = DynaformPeer::retrieveByPk($DYN_UID);
$PRO_UID = $oDynaform->getProUid();
$this->oDynaformHandler = new dynaFormHandler(PATH_DYNAFORM . "{$PRO_UID}/{$DYN_UID}" . '.xml');
$aDynaformFields = $this->oDynaformHandler->getFieldNames();
for ($i = 0; $i < count($aDynaformFields); $i++) {
$aDynaformFields[$i] = "'{$aDynaformFields[$i]}'";
}
$sDynaformFieldsAsStrings = implode(',', $aDynaformFields);
$aRows = $this->getAllByDynUid($DYN_UID, 'active');
$sCode = '';
if (sizeof($aRows) != 0) {
foreach ($aRows as $aRow) {
$hashCond = md5($aRow['FCD_UID']);
$sCondition = $this->parseCondition($aRow['FCD_CONDITION']);
$sCondition = addslashes($sCondition);
$sCode .= "function __condition__{$hashCond}() { ";
$sCode .= "if( eval(\"{$sCondition}\") ) { ";
$aFields = explode(',', $aRow['FCD_FIELDS']);
switch ($aRow['FCD_FUNCTION']) {
case 'show':
foreach ($aFields as $aField) {
$sCode .= "showRowById('{$aField}');";
}
break;
case 'showOnly':
$sCode .= "hideRowsById(Array({$sDynaformFieldsAsStrings}));";
foreach ($aFields as $aField) {
$sCode .= "showRowById('{$aField}');";
}
break;
case 'showAll':
$sCode .= "showRowsById(Array({$sDynaformFieldsAsStrings}));";
break;
case 'hide':
foreach ($aFields as $aField) {
$sCode .= "hideRowById('{$aField}');";
}
break;
case 'hideOnly':
$sCode .= "showRowsById(Array({$sDynaformFieldsAsStrings}));";
foreach ($aFields as $aField) {
$sCode .= "hideRowById('{$aField}');";
}
break;
case 'hideAll':
$aDynaFields = array();
$aEventOwner = explode(',', $aRow['FCD_EVENT_OWNERS']);
foreach ($aDynaformFields as $sDynaformFields) {
if (!in_array(str_replace("'", "", $sDynaformFields), $aEventOwner)) {
$aDynaFields[] = $sDynaformFields;
}
}
$sDynaformFieldsAsStrings = implode(',', $aDynaFields);
$sCode .= "hideRowsById(Array({$sDynaformFieldsAsStrings}));";
break;
}
$sCode .= " } ";
$sCode .= "} ";
$aFieldOwners = explode(',', $aRow['FCD_EVENT_OWNERS']);
$aEvents = explode(',', $aRow['FCD_EVENTS']);
if (in_array('onchange', $aEvents)) {
foreach ($aFieldOwners as $aField) {
//verify the field type
$node = $this->oDynaformHandler->getNode($aField);
$nodeType = $node->getAttribute('type');
switch ($nodeType) {
case 'checkbox':
$sJSEvent = 'click';
break;
case 'text':
case 'textarea':
case 'currency':
case 'percentage':
$sJSEvent = 'blur';
break;
default:
$sJSEvent = 'change';
break;
}
$sCode .= "leimnud.event.add(getField('{$aField}'), '{$sJSEvent}', function() {";
$sCode .= " __condition__{$hashCond}(); ";
$sCode .= "}.extend(getField('{$aField}')));";
}
}
if (in_array('onload', $aEvents)) {
foreach ($aFieldOwners as $aField) {
$sCode .= " __condition__{$hashCond}(); ";
}
}
}
return $sCode;
} else {
return null;
}
}