本文整理汇总了PHP中MUtil_Model_ModelAbstract::getColNames方法的典型用法代码示例。如果您正苦于以下问题:PHP MUtil_Model_ModelAbstract::getColNames方法的具体用法?PHP MUtil_Model_ModelAbstract::getColNames怎么用?PHP MUtil_Model_ModelAbstract::getColNames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MUtil_Model_ModelAbstract
的用法示例。
在下文中一共展示了MUtil_Model_ModelAbstract::getColNames方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addStepChangeTrack
/**
* Add the elements from the model to the bridge for file check step
*
* @param \MUtil_Model_Bridge_FormBridgeInterface $bridge
* @param \MUtil_Model_ModelAbstract $model
*/
protected function addStepChangeTrack(\MUtil_Model_Bridge_FormBridgeInterface $bridge, \MUtil_Model_ModelAbstract $model)
{
$this->displayHeader($bridge, $this->_('Change track information.'), 'h3');
// Load the import data form settings
$this->loadImportData();
// Always add organization select, even when they were not exported
$this->addItems($bridge, $model->getColNames('respondentData'));
// \MUtil_Echo::track($this->formData);
$all = $this->loader->getUtil()->getTrackData()->getAllSurveys();
$available = array('' => $this->_('(skip rounds)')) + $all;
// \MUtil_Echo::track($all);
$form = $bridge->getForm();
$surveyHeader = $form->createElement('Html', 'sheader1');
$surveyHeader->h2($this->_('Survey export code links'));
$form->addElement($surveyHeader);
$surveySubHeader = $form->createElement('Html', 'sheader2');
$surveySubHeader->strong($this->_('Linked survey name'));
$surveySubHeader->setLabel($this->_('Import survey name'))->setDescription(sprintf($this->_('[%s]'), $this->_('export code')))->setRequired(true);
$form->addElement($surveySubHeader);
$this->addItems($bridge, $model->getColNames('isSurvey'));
// \MUtil_Echo::track($this->_session->uploadFileName, $import->getArrayCopy());
}
示例2: loadFormData
/**
* Hook that loads the form data from $_POST or the model
*
* Or from whatever other source you specify here.
*/
protected function loadFormData()
{
if ($this->request->isPost()) {
$this->formData = $this->request->getPost() + $this->formData;
} else {
foreach ($this->importModel->getColNames('default') as $name) {
if (!(isset($this->formData[$name]) && $this->formData[$name])) {
$this->formData[$name] = $this->importModel->get($name, 'default');
}
}
}
if (!(isset($this->formData['import_id']) && $this->formData['import_id'])) {
$this->formData['import_id'] = mt_rand(10000, 99999) . time();
}
$this->_session = new \Zend_Session_Namespace(__CLASS__ . '-' . $this->formData['import_id']);
if (isset($this->formData[$this->stepFieldName]) && $this->formData[$this->stepFieldName] > 1 && !(isset($this->_session->localfile) && $this->_session->localfile)) {
$this->_session->localfile = \MUtil_File::createTemporaryIn($this->tempDirectory, $this->request->getControllerName() . '_');
}
// Must always exists
$this->fileMode = 'file' === $this->formData['mode'];
// Set the translator
$translator = $this->getImportTranslator();
if ($translator instanceof \MUtil_Model_ModelTranslatorInterface) {
$this->importer->setImportTranslator($translator);
}
// \MUtil_Echo::track($_POST, $_FILES, $this->formData);
}