123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- defined('GNUSOCIAL') || die();
- class Sms_carrier extends Managed_DataObject
- {
-
-
- public $__table = 'sms_carrier';
- public $id;
- public $name;
- public $email_pattern;
- public $created;
- public $modified;
-
-
- public 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', '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'),
- ),
- );
- }
- }
|