本文整理汇总了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);
}