本文整理汇总了PHP中Zend_Db_Table类的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Db_Table类的具体用法?PHP Zend_Db_Table怎么用?PHP Zend_Db_Table使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zend_Db_Table类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: aclconfigAction
public function aclconfigAction()
{
$this->_helper->viewRenderer->setNoRender(true);
$this->_helper->layout()->disableLayout();
$methods = get_class_methods('StudentController');
$actions = array();
foreach ($methods as $value) {
$actions[] = substr("{$value}", 0, strpos($value, 'Action'));
}
foreach ($actions as $key => $value) {
if ($value == null) {
unset($actions[$key]);
}
}
$db = new Zend_Db_Table();
$delete2 = 'DELETE FROM `tnp`.`mod_role_resource` WHERE `module_id`=? AND `controller_id`=?';
$db->getAdapter()->query($delete2, array('tnp', 'student'));
$delete1 = 'DELETE FROM `tnp`.`mod_action` WHERE `module_id`=? AND `controller_id`=?';
$db->getAdapter()->query($delete1, array('tnp', 'student'));
print_r(sizeof($actions));
$sql = 'INSERT INTO `tnp`.`mod_action`(`module_id`,`controller_id`,`action_id`) VALUES (?,?,?)';
foreach ($actions as $action) {
$bind = array('tnp', 'student', $action);
$db->getAdapter()->query($sql, $bind);
}
$sql = 'INSERT INTO `tnp`.`mod_role_resource`(`role_id`,`module_id`,`controller_id`,`action_id`) VALUES (?,?,?,?)';
foreach ($actions as $action) {
$bind = array('student', 'tnp', 'student', $action);
$db->getAdapter()->query($sql, $bind);
}
}
开发者ID:sivarajankumar,项目名称:eduis,代码行数:31,代码来源:StudentController.php
示例2: __construct
/**
* Class constructor
*
* @param Zend_Db_Adapter $db Database adapter instance
* @param Zend_Db_Table $table
* @param array $columnMap
* @return void
*/
public function __construct($db, Zend_Db_Table $table, $columnMap = null)
{
$info = $table->info();
parent::__construct($db, $info['schema'] . '.' . $info['name'], $columnMap);
$this->_db = $db;
$this->_table = $table;
$this->_columnMap = $columnMap;
}
开发者ID:knatorski,项目名称:SMS,代码行数:16,代码来源:Synchronization.php
示例3: updateCommentsAd
public function updateCommentsAd($id, $count)
{
$id = (int) $id;
$table = new Zend_Db_Table('commentsAdCount');
$sql = "INSERT INTO commentsAdCount ( id_comment, count ) VALUES ( ?,? )\n ON DUPLICATE KEY UPDATE id_comment = ?, count = ?";
$values = array("id_comment" => $id, "count" => $count);
$result = $table->getAdapter()->query($sql, array_merge(array_values($values), array_values($values)));
}
开发者ID:Arteaga2k,项目名称:nolotiro,代码行数:8,代码来源:Comment.php
示例4: setup
/**
* (non-PHPdoc)
* @see models/Sahara/Auth/Sahara_Auth_Session::setup()
*/
public function setup()
{
$table = new Zend_Db_Table('users');
$record = $table->fetchRow($table->select()->where('name = ?', $this->_authType->getUsername())->where('namespace = ?', $this->_config->institution));
/* User name exists, so no need to create account. */
if ($record) {
return;
}
$table->insert(array('name' => $this->_authType->getUsername(), 'namespace' => $this->_config->institution, 'persona' => 'USER'));
}
开发者ID:jeking3,项目名称:web-interface,代码行数:14,代码来源:SaharaAccount.php
示例5: formAction
public function formAction()
{
$table = new Zend_Db_Table();
$table->setOptions(array('name' => 'test'));
$table->setMetadataCacheInClass(true);
$data = array('listorder' => '11');
$table->insert($data);
Zend_Debug::dump($table);
die;
}
开发者ID:laiello,项目名称:xinhuxi,代码行数:10,代码来源:IndexController.php
示例6: getLastAccess
public static function getLastAccess($classroomId, $data)
{
$access = new Zend_Db_Table('content_access');
$select = $access->select()->where('classroom_id = ?', $classroomId)->order('content_access.id DESC');
$row = $access->fetchRow($select);
if ($row) {
return self::getPositionById($row->content_id, $data);
}
return 0;
}
开发者ID:ramonornela,项目名称:trilhas,代码行数:10,代码来源:Content.php
示例7: getRol
/**
* Retorna el Rol del usuario actual
*
* @return string
*/
private function getRol()
{
$rolStr = 'guest';
if ($this->_auth->hasIdentity()) {
$numRol = $this->_auth->getIdentity()->rol;
$tablaRol = new Zend_Db_Table('roles');
$rol = $tablaRol->fetchRow($tablaRol->select()->from($tablaRol)->where('idRol = ?', $numRol));
$rolStr = $rol['rol'];
}
return $rolStr;
}
开发者ID:blackgios,项目名称:General,代码行数:16,代码来源:CheckAccess.php
示例8: info
/**
* Show table info (DESCRIBE query) for given table
*
* @param array $args
* @return void
*/
public function info(array $args = array())
{
if (empty($args)) {
Garp_Cli::errorOut('Insufficient arguments');
Garp_Cli::lineOut('Usage: garp Db info <tablename>');
return;
}
$db = new Zend_Db_Table($args[0]);
Garp_Cli::lineOut(Zend_Config_Writer_Yaml::encode($db->info()));
Garp_Cli::lineOut('');
}
开发者ID:grrr-amsterdam,项目名称:garp3,代码行数:17,代码来源:Db.php
示例9: indexAction
public function indexAction()
{
$queries = (int) $this->getParam('queries', 1);
$queries = max(1, $queries);
$queries = min(500, $queries);
$table = new Zend_Db_Table('World');
$worlds = array();
for ($i = 0; $i < $queries; $i += 1) {
$worlds[] = $table->fetchRow(array('id = ?' => mt_rand(1, 10000)))->toArray();
}
$this->_helper->json->sendJson($worlds);
}
开发者ID:rappleg,项目名称:FrameworkBenchmarks,代码行数:12,代码来源:DbMultiController.php
示例10: addAction
public function addAction()
{
$form = new Application_Model_ContactForm(array('action' => '/contact/add', 'method' => 'POST'));
if ($this->getRequest()->isPost()) {
if ($form->isValid($this->getRequest()->getPost())) {
$contact = new Zend_Db_Table('contacts');
$data = array('name' => $this->_request->getPost('name'), 'email' => $this->_request->getPost('email'), 'type' => $this->_request->getPost('type'));
$contact->insert($data);
echo "<p>Contact added!</p>";
}
}
$this->view->form = $form;
}
开发者ID:alannet,项目名称:example,代码行数:13,代码来源:ContactsController.php
示例11: filter
/**
* Returns id by name($value) from table
*
* @param string $value
* @return string
*/
public function filter($value)
{
if ($value === null) {
return null;
}
$select = $this->_table->select()->where($this->_field . ' = ?', $value);
$row = $this->_table->fetchRow($select);
if ($row !== null) {
return $row[reset($this->_table->info(Zend_Db_Table::PRIMARY))];
} else {
return null;
}
}
开发者ID:kandy,项目名称:system,代码行数:19,代码来源:NameToId.php
示例12: getTable
function getTable($name)
{
if (!($result = $this->_cache->load($this->_options[$name]['table']))) {
$table = new Zend_Db_Table($this->_options[$name]['table']);
if ($name == 'privilege') {
$sql = new Zend_Db_Select($table->getDefaultAdapter());
$sql->from(array('acl' => $this->_options['privilege']['table']), array('acl.ID_PERFIL'))->join(array('r' => $this->_options['resource']['table']), 'acl.ID_MENU=r.ID_MENU', array('r.URL_MENU', 'acl.PERMISO'));
$result = $table->getAdapter()->fetchAll($sql);
} else {
$result = $table->fetchAll();
}
$this->_cache->save($result, $this->_options[$name]['table']);
}
return $result;
}
开发者ID:josmel,项目名称:DevelEntretenimientoEntel,代码行数:15,代码来源:Acl.php
示例13: _init
private function _init()
{
global $logger;
$oTable = new Zend_Db_Table('path');
foreach ($oTable->fetchAll($oTable->select())->toArray() as $xt) {
$this->_path[] = $xt['name'];
}
$oTable = new Zend_Db_Table('container');
$t = array();
foreach ($oTable->fetchAll($oTable->select())->toArray() as $xt) {
$t[] = $xt['name'];
}
$this->_extensions = implode(',', $t);
$logger->log('Valid extensions are : ' . $this->_extensions, Zend_Log::DEBUG);
}
开发者ID:ka2er,项目名称:mmc-flex,代码行数:15,代码来源:FilmMapper.php
示例14: getTableFields
public function getTableFields($tableName)
{
$db = Zend_Db_Table::getDefaultAdapter();
$columns = $db->query("SELECT menufields FROM main_menu WHERE url = '" . $tableName . "'");
$columnData = $columns->fetch();
return $columnData;
}
开发者ID:uskumar33,项目名称:DeltaONE,代码行数:7,代码来源:Widgets.php
示例15: fillgridAction
public function fillgridAction()
{
$request = $this->getRequest();
$valid = $request->getParam('nd');
if ($valid) {
$this->grid = $this->_helper->grid();
$this->grid->sql = Zend_Db_Table::getDefaultAdapter()->select()->from('opac_issue_return', array('acc_no', 'member_id', 'title', 'author', 'edition', 'issue_date', 'return_date', 'isbn_id', 'status', 'issued_by', 'accepted_by'));
$searchOn = $request->getParam('_search');
if ($searchOn != 'false') {
$sarr = $request->getParams();
foreach ($sarr as $key => $value) {
switch ($key) {
case 'isbn_id':
case 'acc_no':
case 'edition':
case 'status':
case 'member_id':
case 'issued_by':
case 'accepted_by':
$this->grid->sql->where("{$key} = ?", $value);
break;
case 'title':
case 'author':
case 'issue_date':
case 'return_date':
$this->grid->sql->where("{$key} LIKE ?", '%' . $value . '%');
break;
}
}
}
self::fillgridfinal();
} else {
echo '<b>Oops!! </b><br/>No use of peeping like that.. :)';
}
}
开发者ID:sivarajankumar,项目名称:eduis,代码行数:35,代码来源:OpacController.php
示例16: fillgridAction
public function fillgridAction()
{
self::createModel();
$request = $this->getRequest();
$valid = $request->getParam('nd');
if ($request->isXmlHttpRequest() and $valid) {
$this->grid = $this->_helper->grid();
$this->grid->setGridparam($request);
$this->grid->sql = Zend_Db_Table::getDefaultAdapter()->select()->from($this->model->info('name'), array('subject_faculty.subject_code', 'subject_mode_id', 'staff_id', 'subject_department.degree_id', 'department_id', 'department_id', 'subject_department.semester_id'))->joinLeft('subject_department', '(subject_department.subject_code = subject_faculty.subject_code AND subject_department.department_id = subject_faculty.department_id)', array())->where('subject_faculty.department_id = ?', $this->department_id);
$searchOn = $request->getParam('_search');
if ($searchOn != 'false') {
$sarr = $request->getParams();
foreach ($sarr as $key => $value) {
switch ($key) {
case 'staff_id':
$this->grid->sql->where("{$key} LIKE ?", '%' . $value . '%');
break;
case 'subject_code':
$this->grid->sql->where("subject_faculty.subject_code LIKE ?", $value . '%');
break;
case 'subject_mode':
$this->grid->sql->where("subject_faculty.subject_mode_id LIKE ?", $value . '%');
break;
case 'semester_id':
$this->grid->sql->where("subject_department.semester_id = ?", $value);
break;
}
}
}
self::fillgridfinal();
} else {
echo '<b>Oops!! </b><br/>No use of peeping like that... :)';
}
}
开发者ID:sivarajankumar,项目名称:eduis,代码行数:34,代码来源:SubjectfacultyController.php
示例17: checkDuplicateQuestionName
public function checkDuplicateQuestionName($categoryId, $question)
{
$db = Zend_Db_Table::getDefaultAdapter();
$qry = "select count(*) as count from main_pa_questions aq where aq.pa_category_id =" . $categoryId . " AND aq.question='" . $question . "' AND aq.isactive=1 ";
$res = $db->query($qry)->fetchAll();
return $res;
}
开发者ID:uskumar33,项目名称:DeltaONE,代码行数:7,代码来源:Appraisalquestions.php
示例18: getTripPaginatorAdapter
/**
* Get trip paginator adapter
* @param string $filtingField
* @param string $filtingCriteria
* @param string $sortingField
* @return Zend_Paginator_Adapter_DbSelect|Zend_Paginator_Adapter_DbTableSelect
*/
public function getTripPaginatorAdapter($filtingField, $filtingCriteria, $sortingField)
{
$db = Zend_Db_Table::getDefaultAdapter();
$select = $db->select()->from(array('t' => 'trip'), array('t.trip_id', 't.departure_time', 't.arrival_time', 'fare'))->joinInner(array('r' => 'route'), 't.route_id = r.route_id', array('r.from_city', 'r.to_city'));
if (!empty($filtingField)) {
// switch filting field
switch ($filtingField) {
case 'departure_time':
case 'arrival_time':
if (!empty($filtingCriteria)) {
$dateFormat = new Zend_Date($filtingCriteria, 'dd-MM-y HH:mm:ss');
$filtingCriteria = $dateFormat->toString('y-MM-dd HH:mm:ss');
}
break;
case 'from_city':
case 'to_city':
$db = Zend_Db_Table::getDefaultAdapter();
$select = $db->select()->from(array('t' => 'trip'), array('t.trip_id', 't.departure_time', 't.arrival_time', 'fare'))->joinInner(array('r' => 'route'), 't.route_id = r.route_id', array('r.from_city', 'r.to_city'));
break;
default:
break;
}
// add filting criteria
$select->where($filtingField . ' = ?', $filtingCriteria);
}
// add sorting criteria
if (!empty($sortingField)) {
$select->order($sortingField);
}
$adapter = new Zend_Paginator_Adapter_DbSelect($select);
return $adapter;
}
开发者ID:rizkioa,项目名称:etak6,代码行数:39,代码来源:Trip.php
示例19: getQuatre
public function getQuatre($last)
{
//retourne la suite des photos en appel ajax
$db = Zend_Db_Table::getDefaultAdapter();
$requete = 'SELECT * FROM photo WHERE idPhoto < ' . $last . ' ORDER BY idPhoto DESC LIMIT 0,4';
return $db->query($requete)->fetchAll();
}
开发者ID:Cydev2306,项目名称:Nao-App,代码行数:7,代码来源:Photo.php
示例20: insertGroup
public function insertGroup($param)
{
$dbAdapter = Zend_Db_Table::getDefaultAdapter();
$dbAdapter->insert('AGroup', array('name' => $param));
$insertid = $dbAdapter->lastInsertId();
return $insertid;
}
开发者ID:varrbor,项目名称:hanuka.lviv.ua,代码行数:7,代码来源:Model.php
注:本文中的Zend_Db_Table类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论