本文整理汇总了PHP中oxBase类的典型用法代码示例。如果您正苦于以下问题:PHP oxBase类的具体用法?PHP oxBase怎么用?PHP oxBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了oxBase类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: validateFields
/**
* Checks if all required fields are filled.
* Returns array of invalid fields or empty array if all fields are fine.
*
* @param oxBase $oObject Address fields with values.
*
* @return bool If any invalid field exist.
*/
public function validateFields($oObject)
{
$aRequiredFields = $this->getRequiredFields();
$oFieldValidator = $this->getFieldValidator();
$aInvalidFields = array();
foreach ($aRequiredFields as $sFieldName) {
if (!$oFieldValidator->validateFieldValue($oObject->getFieldData($sFieldName))) {
$aInvalidFields[] = $sFieldName;
}
}
$this->_setInvalidFields($aInvalidFields);
return empty($aInvalidFields);
}
开发者ID:ioanok,项目名称:symfoxid,代码行数:21,代码来源:oxrequiredfieldsvalidator.php
示例2: __construct
/**
* Class constructor, initiates parent constructor (parent::oxBase()) and sets table name.
*/
public function __construct()
{
parent::__construct();
$this->init('oxobject2category');
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:8,代码来源:oxobject2category.php
示例3: _postSaveObject
/**
* post saving hook. can finish transactions if needed or ajust related data
*
* @param oxBase $oShopObject shop object
* @param data $aData data to save
*
* @return mixed data to return
*/
protected function _postSaveObject($oShopObject, $aData)
{
$sOXID = $oShopObject->getId();
$oShopObject->onChange(null, $sOXID, $sOXID);
// returning ID on success
return $sOXID;
}
开发者ID:mibexx,项目名称:oxid_yttutorials,代码行数:15,代码来源:oxerptype_article.php
示例4: _postSaveObject
/**
* post saving hook. can finish transactions if needed or ajust related data
*
* @param oxBase $oShopObject shop object
* @param data $aData data to save
*
* @return mixed data to return
*/
protected function _postSaveObject($oShopObject, $aData)
{
// returning ID on success
return $oShopObject->getId();
}
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:13,代码来源:oxerptype.php
示例5: __construct
/**
* Class constructor, initiates parent constructor (parent::oxBase()).
*/
public function __construct()
{
parent::__construct();
$this->init('oxratings');
}
开发者ID:Alpha-Sys,项目名称:oxideshop_ce,代码行数:8,代码来源:Rating.php
示例6: createObj2Obj
/**
* Create object 2 object connection in databse
*
* @param array $aData db fields and values
* @param string $sObj2ObjTable table name
*/
public function createObj2Obj($aData, $sObj2ObjTable)
{
if (empty($aData)) {
return;
}
$iCnt = count($aData);
for ($i = 0; $i < $iCnt; $i++) {
$oObj = new oxBase();
$oObj->init($sObj2ObjTable);
if ($iCnt < 2) {
$aObj = $aData[$i];
} else {
$aObj = $aData;
}
foreach ($aObj as $sKey => $sValue) {
$sField = $sObj2ObjTable . "__" . $sKey;
$oObj->{$sField} = new oxField($sValue, oxField::T_RAW);
}
$oObj->save();
}
}
开发者ID:Juergen-Busch,项目名称:paypal,代码行数:27,代码来源:oepaypalshopconstruct.php
示例7: _setFieldData
/**
* Sets data field value
*
* @param string $sFieldName index OR name (eg. 'oxarticles__oxtitle') of a data field to set
* @param string $sValue value of data field
* @param int $iDataType field type
*
* @return null
*/
protected function _setFieldData($sFieldName, $sValue, $iDataType = oxField::T_TEXT)
{
if ('oxvalue' === $sFieldName) {
$iDataType = oxField::T_RAW;
}
return parent::_setFieldData($sFieldName, $sValue, $iDataType);
}
开发者ID:ioanok,项目名称:symfoxid,代码行数:16,代码来源:oxstatistic.php
示例8: _insert
/**
* Inserts object data fields in DB. Returns true on success.
*
* @return bool
*/
protected function _insert()
{
// set oxcreate
$sNow = date('Y-m-d H:i:s', oxRegistry::get("oxUtilsDate")->getTime());
$this->oxremark__oxcreate = new oxField($sNow, oxField::T_RAW);
$this->oxremark__oxheader = new oxField($sNow, oxField::T_RAW);
return parent::_insert();
}
开发者ID:Crease29,项目名称:oxideshop_ce,代码行数:13,代码来源:oxremark.php
示例9: save
/**
* Extends the default save method.
* Saves only if this kind of entry do not exists.
*
* @return bool
*/
public function save()
{
$oDb = oxDb::getDb();
$sQ = "select 1 from oxobject2group where oxgroupsid = " . $oDb->quote($this->oxobject2group__oxgroupsid->value);
$sQ .= " and oxobjectid = " . $oDb->quote($this->oxobject2group__oxobjectid->value);
// does not exist
if (!$oDb->getOne($sQ, false, false)) {
return parent::save();
}
}
开发者ID:ioanok,项目名称:symfoxid,代码行数:16,代码来源:oxobject2group.php
示例10: delete
/**
* Override delete function so we can delete user group and article or category relations first.
*
* @param string $sOxId object ID (default null)
*
* @return null
*/
public function delete($sOxId = null)
{
if (!$sOxId) {
$sOxId = $this->getId();
}
$this->unsetDiscountRelations();
$this->unsetUserGroups();
$this->deleteVoucherList();
return parent::delete($sOxId);
}
开发者ID:mibexx,项目名称:oxid_yttutorials,代码行数:17,代码来源:oxvoucherserie.php
示例11: save
/**
* Extends the default save method.
* Saves only if this kind of entry do not exists.
*
* @throws DatabaseException
*
* @return bool
*/
public function save()
{
try {
return parent::save();
} catch (\OxidEsales\EshopCommunity\Core\Exception\DatabaseException $exception) {
/**
* The table oxobject2group has an UNIQUE index on (OXGROUPSID, OXOBJECTID, OXSHOPID)
* If there is a DatabaseException and the exception code is 1062 i.e. "Duplicate entry",
* the exception will be discarded and the record will not be inserted.
*/
if ($exception->getCode() != '1062') {
throw $exception;
}
}
}
开发者ID:Alpha-Sys,项目名称:oxideshop_ce,代码行数:23,代码来源:Object2Group.php
示例12: __construct
/**
* Class constructor
*
* @return null
*/
public function __construct()
{
parent::__construct();
$this->init('oxaddress');
}
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:10,代码来源:oxaddress.php
示例13: save
/**
* Save this Object to database, insert or update as needed.
*
* @return mixed
*/
public function save()
{
if (!$this->oxrecommlists__oxtitle->value) {
throw oxNew("oxObjectException", 'EXCEPTION_RECOMMLIST_NOTITLE');
}
return parent::save();
}
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:12,代码来源:oxrecommlist.php
示例14: delete
/**
* Deletes oxFile record from DB, removes orphan files.
*
* @param string $sOxId default null
*
* @return bool
*/
public function delete($sOxId = null)
{
$sOxId = $sOxId ? $sOxId : $this->getId();
$this->load($sOxId);
// if record cannot be delete, abort deletion
if ($blDeleted = parent::delete($sOxId)) {
$this->_deleteFile();
}
return $blDeleted;
}
开发者ID:mibexx,项目名称:oxid_yttutorials,代码行数:17,代码来源:oxfile.php
示例15: _update
/**
* Updates payment record in DB. Returns update status.
*
* @return bool
*/
protected function _update()
{
$oDb = oxDb::getDb();
//encode sensitive data
if ($sValue = $this->oxuserpayments__oxvalue->value) {
$sEncodedValue = $oDb->getOne("select encode( " . $oDb->quote($sValue) . ", '" . $this->getPaymentKey() . "' )", false, false);
$this->oxuserpayments__oxvalue->setValue($sEncodedValue);
}
$blRet = parent::_update();
//restore, as encoding was needed only for saving
if ($sEncodedValue) {
$this->oxuserpayments__oxvalue->setValue($sValue);
}
return $blRet;
}
开发者ID:ioanok,项目名称:symfoxid,代码行数:20,代码来源:oxuserpayment.php
示例16: _insert
/**
* Sets article creation date
* (oxorderarticle::oxorderarticles__oxtimestamp). Then executes parent method
* parent::_insert() and returns insertion status.
*
* @return bool
*/
protected function _insert()
{
$iInsertTime = time();
$now = date('Y-m-d H:i:s', $iInsertTime);
$this->oxorderarticles__oxtimestamp = new oxField($now);
return parent::_insert();
}
开发者ID:Alpha-Sys,项目名称:oxideshop_ce,代码行数:14,代码来源:OrderArticle.php
示例17: _update
/**
* We need to check if we unsubscribe here
*
* @return mixed oxid on success or false on failure
*/
protected function _update()
{
if (($this->_blWasSubscribed || $this->_blWasPreSubscribed) && !$this->oxnewssubscribed__oxdboptin->value) {
// set unsubscription date
$this->oxnewssubscribed__oxunsubscribed->setValue(date('Y-m-d H:i:s'));
// 0001974 Same object can be called many times without requiring to renew date.
// If so happens, it would have _aSkipSaveFields set to skip date field. So need to check and
// release if _aSkipSaveFields are set for field oxunsubscribed.
$aSkipSaveFieldsKeys = array_keys($this->_aSkipSaveFields, 'oxunsubscribed');
foreach ($aSkipSaveFieldsKeys as $iSkipSaveFieldKey) {
unset($this->_aSkipSaveFields[$iSkipSaveFieldKey]);
}
} else {
// don't update date
$this->_aSkipSaveFields[] = 'oxunsubscribed';
}
return parent::_update();
}
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:23,代码来源:oxnewssubscribed.php
示例18: _getFieldLongName
/**
* returns long name
*
* @param string $sFieldName - field name
*
* @return string
*/
protected function _getFieldLongName($sFieldName)
{
$aFieldNames = array('oxorderfiles__oxarticletitle', 'oxorderfiles__oxarticleartnum', 'oxorderfiles__oxordernr', 'oxorderfiles__oxorderdate', 'oxorderfiles__oxispaid', 'oxorderfiles__oxpurchasedonly');
if (in_array($sFieldName, $aFieldNames)) {
return $sFieldName;
}
return parent::_getFieldLongName($sFieldName);
}
开发者ID:ioanok,项目名称:symfoxid,代码行数:15,代码来源:oxorderfile.php
示例19: _insert
/**
* Inserts new guestbook entry. Returns true on success.
*
* @return bool
*/
protected function _insert()
{
// set oxcreate
$this->oxgbentries__oxcreate = new oxField(date('Y-m-d H:i:s', oxUtilsDate::getInstance()->getTime()));
return parent::_insert();
}
开发者ID:JulianaSchuster,项目名称:oxid-frontend,代码行数:11,代码来源:oxgbentry.php
示例20: __construct
/**
* Class constructor
*/
public function __construct()
{
parent::__construct();
$this->init($this->_sClassName);
}
开发者ID:SiWe0401,项目名称:paymill-oxid,代码行数:8,代码来源:paymill_transaction.php
注:本文中的oxBase类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论