本文整理汇总了PHP中F0FTable::check方法的典型用法代码示例。如果您正苦于以下问题:PHP F0FTable::check方法的具体用法?PHP F0FTable::check怎么用?PHP F0FTable::check使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类F0FTable
的用法示例。
在下文中一共展示了F0FTable::check方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check
public function check()
{
$date = new JDate($this->date_from);
$this->date_from = $date->toSql();
$date1 = new JDate($this->date_to);
$this->date_to = $date1->toSql();
return parent::check();
}
示例2: check
public function check()
{
$status = parent::check();
//to throw error when optionvalue id is empty
/* if(!$this->optionvalue_id){
$this->setError(JText::_('J2STORE_PRODUCT_OPTION_VALUE_MISSING'));
$status = false;
} */
return $status;
}
示例3: check
public function check()
{
if (!isset($this->product_source) || empty($this->product_source)) {
$this->setError(JText::_('J2STORE_PRODUCT_SOURCE_NOT_FOUND'));
return false;
}
if (!isset($this->product_source_id) || empty($this->product_source_id)) {
$this->setError(JText::_('J2STORE_PRODUCT_SOURCE_ID_NOT_FOUND'));
return false;
}
return parent::check();
}
示例4: check
public function check()
{
$result = true;
if (!$this->title) {
$this->setError(JText::_('COM_AKEEBASUBS_APICOUPONS_ERR_TITLE'));
$result = false;
}
if (!$this->key) {
$this->key = md5(microtime());
}
if (!$this->password) {
$this->password = md5(microtime());
}
// Make sure assigned subscriptions really do exist and normalize the list
if (!empty($this->subscriptions)) {
if (is_array($this->subscriptions)) {
$subs = $this->subscriptions;
} else {
$subs = explode(',', $this->subscriptions);
}
if (empty($subs)) {
$this->subscriptions = '';
} else {
$subscriptions = array();
foreach ($subs as $id) {
$subObject = F0FModel::getTmpInstance('Levels', 'AkeebasubsModel')->setId($id)->getItem();
$id = null;
if (is_object($subObject)) {
if ($subObject->akeebasubs_level_id > 0) {
$id = $subObject->akeebasubs_level_id;
}
}
if (!is_null($id)) {
$subscriptions[] = $id;
}
}
$this->subscriptions = implode(',', $subscriptions);
}
}
// Check the type
if (!in_array($this->type, array('value', 'percent'))) {
$this->type = 'value';
}
// Check value
if ($this->value < 0) {
$this->setError(JText::_('COM_AKEEBASUBS_COUPON_ERR_VALUE'));
$result = false;
} elseif ($this->value > 100 && $this->type == 'percent') {
$this->value = 100;
}
return parent::check() && $result;
}
示例5: check
/**
* Overrides the automated table checks to handle the 'hash' column for faster searching
*
* @return boolean
*/
public function check()
{
// Create a slug if there is a title and an empty slug
if ($this->hasField('title') && $this->hasField('slug') && empty($this->slug)) {
$this->slug = F0FStringUtils::toSlug($this->title);
}
// Create the SHA-1 hash of the slug for faster searching (make sure the hash column is CHAR(64) to take
// advantage of MySQL's optimised searching for fixed size CHAR columns)
if ($this->hasField('hash') && $this->hasField('slug')) {
$this->hash = sha1($this->slug);
}
// Reset cached values
$this->resetTreeCache();
return parent::check();
}
示例6: check
public function check()
{
$result = parent::check();
if (empty($this->slug)) {
$this->setError(JText::_('COM_AKEEBASUBS_ERR_SLUG_EMPTY'));
$result = false;
} else {
$pattern = '/^[a-z_][a-z0-9_\\-]*$/';
if (!preg_match($pattern, $this->slug)) {
$this->setError(JText::_('COM_AKEEBASUBS_ERR_SLUG_INVALID'));
$result = false;
}
}
return $result;
}
示例7: check
public function check()
{
$result = true;
if (!$this->country_name) {
$this->setError(JText::_('COM_J2STORE_COUNTRY_MISSING'));
$result = false;
}
if (!$this->country_isocode_2) {
$this->setError(JText::_('COM_J2STORE_COUNTRY_ISOCODE2_MISSING'));
$result = false;
}
if (!$this->country_isocode_3) {
$this->setError(JText::_('COM_J2STORE_COUNTRY_ISOCODE3_MISSING'));
$result = false;
}
return parent::check() && $result;
}
示例8: check
public function check()
{
$result = true;
//check variant id exists
if (empty($this->product_id)) {
$this->setError(JText::_('COM_J2STORE_VARIANT_ID_MISSING'));
$result = false;
}
if (empty($this->product_file_display_name)) {
$this->setError(JText::_('J2STORE_PRODUCT_FILE_DISPLAY_NAME_IS_EMPTY'));
$result = false;
}
//check product file path is not empty
if (empty($this->product_file_save_name)) {
$this->setError(JText::_('J2STORE_PRODUCT_FILE_PATH_IS_EMPTY'));
$result = false;
}
//to check given file path is valid
if ($this->checkAttachmentPathExists()) {
$this->setError(JText::_('J2STORE_PRODUCT_FILE_PATH_IS_EMPTY'));
$result = false;
}
return parent::check() && $result;
}