3 * Table Definition for sms_carrier
5 require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
7 class Sms_carrier extends Managed_DataObject
10 /* the code below is auto generated do not remove the above tag */
12 public $__table = 'sms_carrier'; // table name
13 public $id; // int(4) primary_key not_null
14 public $name; // varchar(64) unique_key
15 public $email_pattern; // varchar(255) not_null
16 public $created; // datetime() not_null
17 public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
20 function staticGet($k,$v=null)
21 { return Memcached_DataObject::staticGet('Sms_carrier',$k,$v); }
23 /* the code above is auto generated do not remove the tag below */
26 function toEmailAddress($sms)
28 return sprintf($this->email_pattern, $sms);
31 public static function schemaDef()
35 'id' => array('type' => 'int', 'not null' => true, 'description' => 'primary key for SMS carrier'),
36 'name' => array('type' => 'varchar', 'length' => 64, 'description' => 'name of the carrier'),
37 'email_pattern' => array('type' => 'varchar', 'length' => 255, 'not null' => true, 'description' => 'sprintf pattern for making an email address from a phone number'),
38 'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
39 'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
41 'primary key' => array('id'),
42 'unique keys' => array(
43 'sms_carrier_name_key' => array('name'),