本文整理汇总了PHP中ca_objects::getDb方法的典型用法代码示例。如果您正苦于以下问题:PHP ca_objects::getDb方法的具体用法?PHP ca_objects::getDb怎么用?PHP ca_objects::getDb使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ca_objects
的用法示例。
在下文中一共展示了ca_objects::getDb方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _setCurrent
/**
*
*/
private function _setCurrent($pm_rel_table_name_or_num, $pn_rel_id)
{
switch ($this->tableName()) {
case 'ca_movements':
// Calcuate current flag for relationships to storage locations and objects
if (($vs_date_element = $this->getAppConfig()->get('movement_storage_location_date_element')) && ($vs_rel_table = $this->getAppDatamodel()->getTableName($pm_rel_table_name_or_num)) == 'ca_objects') {
// get all other movements for this object
$t_object = new ca_objects();
$t_object->setTransaction($this->getTransaction());
if ($t_object->load($pn_rel_id)) {
if ($qr_movements_for_object = ca_movements_x_objects::find(array('object_id' => $pn_rel_id), array('returnAs' => 'SearchResult'))) {
$va_list = array();
while ($qr_movements_for_object->nextHit()) {
$va_list[$qr_movements_for_object->get("ca_movements.{$vs_date_element}", array('sortable' => true))] = $qr_movements_for_object->get('ca_movements_x_objects.relation_id');
}
ksort($va_list, SORT_NUMERIC);
$vn_current = array_pop($va_list);
if (sizeof($va_list)) {
$t_object->getDb()->query("UPDATE ca_movements_x_objects SET source_info = '' WHERE relation_id IN (?)", array(array_values($va_list)));
$t_object->getDb()->query("UPDATE ca_movements_x_storage_locations SET source_info = '' WHERE movement_id IN (SELECT movement_id FROM ca_movements_x_objects WHERE relation_id IN (?))", array(array_values($va_list)));
}
if ($vn_current) {
$t_object->getDb()->query("UPDATE ca_movements_x_objects SET source_info = 'current' WHERE relation_id = ?", array($vn_current));
$t_object->getDb()->query("UPDATE ca_movements_x_storage_locations SET source_info = 'current' WHERE movement_id IN (SELECT movement_id FROM ca_movements_x_objects WHERE relation_id = ?)", array($vn_current));
}
}
}
}
break;
}
}
示例2: testGetAttributeCount
public function testGetAttributeCount()
{
$t_element = ca_attributes::getElementInstance('internal_notes');
$this->opt_object->getDb()->dieOnError(true);
$this->assertEquals(2, ca_attributes::getAttributeCount($this->opt_object->getDb(), $this->opt_object->tableNum(), $this->opt_object->getPrimaryKey(), $t_element->getPrimaryKey()));
}