本文整理匯總了PHP中Languages::fetchAll方法的典型用法代碼示例。如果您正苦於以下問題:PHP Languages::fetchAll方法的具體用法?PHP Languages::fetchAll怎麽用?PHP Languages::fetchAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Languages
的用法示例。
在下文中一共展示了Languages::fetchAll方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getAllWebSiteLanguage
public function getAllWebSiteLanguage()
{
$languageSelect = new Languages();
$select = $languageSelect->select();
$languageData = $languageSelect->fetchAll($select);
return $languageData;
}
示例2: setMultiLanguage
public function setMultiLanguage($key = true)
{
if ($key) {
$languages = new Languages();
$langAll = $languages->fetchAll();
if ($langAll->count()) {
$elements = $this->getElements();
$subFrms = array();
foreach ($langAll as $lang) {
$sf = new Zend_Form_SubForm();
foreach ($elements as $element) {
if (preg_match('/translate/', $element->getAttrib('class'))) {
$newElement = clone $element;
$newElement->setAttrib('id', $lang->codigo . '-' . $newElement->getName());
$sf->addElement($newElement);
}
}
$sf->setDecorators($this->getDecorators());
$subFrms[$lang->codigo] = $sf;
}
$this->addSubForms($subFrms);
}
}
return $this;
}
示例3: toArray
public function toArray()
{
$r = parent::toArray();
$languages = new Languages();
$langs = $languages->fetchAll();
$data = array();
if ($this->__get('id') && $langs->count()) {
$languages_values = new Languages_Values();
foreach ($langs as $lang) {
$data[$lang->codigo] = array();
$values = $languages_values->fetchAll(array('tabela = ?' => $this->getTable()->info('name'), 'registro = ?' => $this->__get('id'), 'lang_id = ?' => $lang->id));
if ($values->count()) {
foreach ($values as $row) {
$data[$lang->codigo][$row->campo] = $row->valor;
}
}
}
}
return !count($data) ? $r : array_merge($r, $data);
}