1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
- class Sms_carrier extends Managed_DataObject
- {
-
-
- public $__table = 'sms_carrier';
- public $id;
- public $name;
- public $email_pattern;
- public $created;
- public $modified;
-
-
- function toEmailAddress($sms)
- {
- return sprintf($this->email_pattern, $sms);
- }
- public static function schemaDef()
- {
- return array(
- 'fields' => array(
- 'id' => array('type' => 'int', 'not null' => true, 'description' => 'primary key for SMS carrier'),
- 'name' => array('type' => 'varchar', 'length' => 64, 'description' => 'name of the carrier'),
- 'email_pattern' => array('type' => 'varchar', 'length' => 191, 'not null' => true, 'description' => 'sprintf pattern for making an email address from a phone number'),
- 'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
- 'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
- ),
- 'primary key' => array('id'),
- 'unique keys' => array(
- 'sms_carrier_name_key' => array('name'),
- ),
- );
- }
- }
|