+
+ 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' => 255, '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'),
+ ),
+ );
+ }