本文整理匯總了PHP中Sql::lastRow方法的典型用法代碼示例。如果您正苦於以下問題:PHP Sql::lastRow方法的具體用法?PHP Sql::lastRow怎麽用?PHP Sql::lastRow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Sql
的用法示例。
在下文中一共展示了Sql::lastRow方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: save
/**
* Save Tag
* @return bollean
*/
public function save()
{
$data = array(self::ID_TAG => $this->getIdTag(), self::TAG => $this->getTag());
$sql = new Sql();
if (is_null($this->getIdTag())) {
$sql->insert($data, self::TABLE);
$this->idTag = $sql->lastRow(self::TABLE)->id_tag;
return true;
} else {
$pk = array(self::ID_TAG => $this->getIdTag());
return $sql->update($data, self::TABLE, $pk);
}
}
示例2: save
/**
* Save Log
* @return bollean
*/
public function save()
{
$data = array(self::ID => self::getId(), self::DATE => self::getDate(), self::FILE => self::getFile(), self::MESSAGE => self::getMessage(), self::IS_ERROR => self::getIsError());
$sql = new Sql();
if (is_null($this->getId())) {
$sql->insert($data, self::TABLE);
$this->id = $sql->lastRow(self::TABLE)->id;
return true;
} else {
$pk = array(self::ID => self::getId());
return $sql->update($data, self::TABLE, $pk);
}
}
示例3: save
/**
* Save
* @return bollean
*/
public function save()
{
$data = array(self::ISOLANG => $this->getIsoLang(), self::DEFAULT_CULTURE => $this->getDefault());
$sql = new Sql();
if (!self::hasCulture($this->getIsoLang())) {
$sql->insert($data, self::TABLE);
$this->isolang = $sql->lastRow(self::TABLE)->isolang;
return true;
} else {
$pk = array(self::ISOLANG => $this->getIsoLang());
return $sql->update($data, self::TABLE, $pk);
}
}
示例4: save
/**
* Save Tag
* @return bollean
*/
public function save()
{
$data = array(self::ID_TAG_I18N => $this->getIdTagI18n(), self::ID_TAG => $this->getIdTag(), self::ISOLANG => $this->getIsoLang(), self::TRANSLATE => $this->getTranslate());
$sql = new Sql();
if (is_null($this->getIdTagI18n())) {
$sql->insert($data, self::TABLE);
$this->idTagI18n = $sql->lastRow(self::TABLE) ? $sql->lastRow(self::TABLE)->id_tag_i18n : '';
$this->idTag = $sql->lastRow(self::TABLE) ? $sql->lastRow(self::TABLE)->id_tag : '';
return true;
} else {
$pk = array(self::ID_TAG_I18N => $this->getIdTagI18n());
return $sql->update($data, self::TABLE, $pk);
}
}