本文整理汇总了PHP中AbstractModel::getIsEditable方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractModel::getIsEditable方法的具体用法?PHP AbstractModel::getIsEditable怎么用?PHP AbstractModel::getIsEditable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AbstractModel
的用法示例。
在下文中一共展示了AbstractModel::getIsEditable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getArrayDataFieldEcheancesForProcessusCycle
public function getArrayDataFieldEcheancesForProcessusCycle()
{
$dateEcheanceFta = $this->getDataField(FtaModel::FIELDNAME_DATE_ECHEANCE_FTA)->getFieldValue();
$isEcheanceForThisFtaExist = NULL;
//Date par processus
$annee_date_echeance_fta = substr($dateEcheanceFta, 0, 4);
$mois_date_echeance_fta = substr($dateEcheanceFta, 5, 2);
$jour_date_echeance_fta = substr($dateEcheanceFta, 8, 2);
$arrayModelFtaProcessusDelaiByIdProcessus = $this->getArrayModelFtaProcessusDelaiByIdProcessus();
//Sélection de tous les processus appartenant au cycle de vie de la FTA
$arrayIdProcessusFromFtaCycleDeVie = $this->getArrayIdProcessusFromFtaCycleDeVie();
foreach ($arrayIdProcessusFromFtaCycleDeVie as $rows) {
//Extraction des données du tableau PHP
$idFtaProcessus = $rows[FtaProcessusModel::KEYNAME];
$WeekSinceFirstProcessus = $rows[FtaProcessusCycleModel::FIELDNAME_DELAI];
//Processus défini pour ce cycle de vie
$modelFtaProcessusForCycle = new FtaProcessusModel($idFtaProcessus);
//La FTA a-t-elle une échéance de renseignée pour ce processus ?
if ($arrayModelFtaProcessusDelaiByIdProcessus != NULL) {
$isEcheanceForThisFtaExist = array_key_exists($modelFtaProcessusForCycle->getKeyValue(), $arrayModelFtaProcessusDelaiByIdProcessus);
}
if ($isEcheanceForThisFtaExist) {
//Si il existe, on récupère ce délai
$modelFtaProcessusDelai = $arrayModelFtaProcessusDelaiByIdProcessus[$modelFtaProcessusForCycle->getKeyValue()];
} else {
//Si il n'existe pas, il faut initialiser l'échéance
$modelFtaProcessusDelai = new FtaProcessusDelaiModel();
$modelFtaProcessusDelai->setModelFtaById($this->getKeyValue());
$modelFtaProcessusDelai->setModelFtaProcessusById($modelFtaProcessusForCycle->getKeyValue());
//Mise à jour du tableau
$arrayModelFtaProcessusDelaiByIdProcessus[$modelFtaProcessusForCycle->getDataField(FtaProcessusDelaiModel::FIELDNAME_ID_FTA_PROCESSUS)->getFieldValue()] = $modelFtaProcessusDelai;
}
//Récupération de la date d'échéance de la FTA définie pour ce processus
if (($dateEcheanceFta == NULL or $dateEcheanceFta == "0000-00-00") and parent::getIsEditable()) {
$modelFtaProcessusDelai->getDataField(FtaProcessusDelaiModel::FIELDNAME_DATE_ECHEANCE_PROCESSUS)->setFieldValue("");
} else {
$delai_jour = $WeekSinceFirstProcessus * ModuleConfig::DELAI_ECHEANCE_PROCESSUS_JOUR;
$timestamp_date_echeance_fta = mktime(0, 0, 0, $mois_date_echeance_fta, $jour_date_echeance_fta - $delai_jour, $annee_date_echeance_fta);
$dateDefaultEcheance = date("d-m-Y", $timestamp_date_echeance_fta);
$modelFtaProcessusDelai->getDataField(FtaProcessusDelaiModel::FIELDNAME_DATE_ECHEANCE_PROCESSUS)->setFieldValue($dateDefaultEcheance);
}
$modelFtaProcessusDelai->saveToDatabase();
// $arrayDataFieldEcheancesForProcessusCycle[] = $modelFtaProcessusDelai->getDataField(FtaProcessusDelaiModel::FIELDNAME_DATE_ECHEANCE_PROCESSUS);
$arrayDataFieldEcheancesForProcessusCycle[] = $modelFtaProcessusDelai;
//Construction des objets HTML de date
// $labelEcheance = "Echéance pour " . $modelFtaProcessusDelai->getModelFtaProcessus()->getDataField(FtaProcessusModel::FIELDNAME_SERVICE)->getFieldValue() . ": ";
// $dataFieldEcheance = $modelFtaProcessusDelai->getDataField(FtaProcessusDelaiModel::FIELDNAME_DATE_ECHEANCE_PROCESSUS);
// $dataFieldEcheance->setLabelCustom($labelEcheance);
//
// $HtmlElementEcheance = new DataFieldToHtmlInputCalendar($dataFieldEcheance);
//
// $blocEcheanceLignes .= $HtmlElementEcheance->getHtmlResult();
}
return $arrayDataFieldEcheancesForProcessusCycle;
}