class.phonenumber.php
来自「Professional PHP5 code for this book」· PHP 代码 · 共 37 行
PHP
37 行
<?php require_once('class.PropertyObject.php'); class PhoneNumber extends PropertyObject { function __construct($phoneid) { $arData = DataManager::getPhoneNumberData($phoneid); parent::__construct($arData); $this->propertyTable['phoneid'] = 'phoneid'; $this->propertyTable['id'] = 'phoneid'; $this->propertyTable['entityid'] = 'entityid'; $this->propertyTable['number'] = 'snumber'; $this->propertyTable['extension'] = 'sextension'; $this->propertyTable['type'] = 'stype'; } function validate() { if(!$this->number) { $this->errors['number'] = 'You must supply a phone number.'; } if(sizeof($this->errors)) { return false; } else { return true; } } function __toString() { return $this->number . ($this->extension ? ' x' . $this->extension : ''); } }?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?