本文整理汇总了PHP中Centurion_Db::getRow方法的典型用法代码示例。如果您正苦于以下问题:PHP Centurion_Db::getRow方法的具体用法?PHP Centurion_Db::getRow怎么用?PHP Centurion_Db::getRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Centurion_Db
的用法示例。
在下文中一共展示了Centurion_Db::getRow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
public function update(array $data, $where)
{
$currentFileRow = $this->fetchRow($where);
if (null !== $currentFileRow->proxy_model) {
$oldProxyTableClass = $currentFileRow->proxy_model;
}
foreach ($currentFileRow->duplicates as $duplicate) {
$duplicate->delete();
}
foreach ($this->_dependentProxies as $key => $dependentProxy) {
$proxyTable = Centurion_Db::getSingletonByClassName($dependentProxy);
$mimes = array_keys($proxyTable->getMimeTypes());
if (!in_array($data['mime'], $mimes)) {
continue;
}
if (in_array($data['mime'], $mimes)) {
$newProxyTableClass = $dependentProxy;
break;
}
}
if (!isset($data['sha1'])) {
$data['sha1'] = sha1_file(Centurion_Config_Manager::get('media.uploads_dir') . DIRECTORY_SEPARATOR . $data['local_filename']);
}
if (isset($oldProxyTableClass) && $oldProxyTableClass != $newProxyTableClass) {
$currentProxyRow = Centurion_Db::getRow($oldProxyTableClass, $currentFileRow->proxy_pk);
if (null !== $currentProxyRow) {
$data = array_merge($data, array('proxy_model' => null, 'proxy_pk' => null));
$currentProxyRow->delete();
}
}
if (null !== $newProxyTableClass) {
$newProxyTable = Centurion_Db::getSingletonByClassName($newProxyTableClass);
if (isset($oldProxyTableClass) && $oldProxyTableClass == $newProxyTableClass) {
$pk = $newProxyTable->update($data, $newProxyTable->getAdapter()->quoteInto('id = ?', $currentFileRow->proxy_pk));
} else {
$pk = $newProxyTable->insert($data);
$data['proxy_model'] = $newProxyTableClass;
}
$data['proxy_pk'] = $pk;
}
if (array_key_exists(self::BELONG_TO, $data)) {
list($model, $pk) = $this->_setupProxyBelong($data[self::BELONG_TO]);
$data = array_merge($data, array('belong_model' => $model, 'belong_pk' => $pk));
unset($data[self::BELONG_TO]);
}
return parent::update($data, $where);
}