2008-06-20 14:15:36 +09:00
|
|
|
<?php
|
|
|
|
/**
|
2008-06-23 00:50:28 +09:00
|
|
|
* Table Definition for confirm_address
|
2008-06-20 14:15:36 +09:00
|
|
|
*/
|
2008-09-27 01:18:24 +09:00
|
|
|
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
|
2008-06-20 14:15:36 +09:00
|
|
|
|
2008-09-27 01:09:41 +09:00
|
|
|
class Confirm_address extends Memcached_DataObject
|
2008-06-20 14:15:36 +09:00
|
|
|
{
|
|
|
|
###START_AUTOCODE
|
|
|
|
/* the code below is auto generated do not remove the above tag */
|
|
|
|
|
2008-06-23 00:50:28 +09:00
|
|
|
public $__table = 'confirm_address'; // table name
|
2008-06-20 14:15:36 +09:00
|
|
|
public $code; // varchar(32) primary_key not_null
|
|
|
|
public $user_id; // int(4) not_null
|
2008-06-23 00:50:28 +09:00
|
|
|
public $address; // varchar(255) not_null
|
2008-06-23 01:16:07 +09:00
|
|
|
public $address_extra; // varchar(255) not_null
|
|
|
|
public $address_type; // varchar(8) not_null
|
2008-07-16 04:55:13 +09:00
|
|
|
public $claimed; // datetime()
|
|
|
|
public $sent; // datetime()
|
2008-06-20 14:15:36 +09:00
|
|
|
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
|
|
|
|
|
|
|
/* Static get */
|
2008-12-24 04:33:23 +09:00
|
|
|
function staticGet($k,$v=null)
|
|
|
|
{ return Memcached_DataObject::staticGet('Confirm_address',$k,$v); }
|
2008-06-20 14:15:36 +09:00
|
|
|
|
|
|
|
/* the code above is auto generated do not remove the tag below */
|
|
|
|
###END_AUTOCODE
|
2008-07-10 07:46:30 +09:00
|
|
|
|
2008-12-24 04:33:23 +09:00
|
|
|
function sequenceKey()
|
|
|
|
{ return array(false, false); }
|
2011-04-18 06:46:32 +09:00
|
|
|
|
|
|
|
static function getAddress($address, $addressType)
|
|
|
|
{
|
|
|
|
$ca = new Confirm_address();
|
|
|
|
|
|
|
|
$ca->address = $address;
|
|
|
|
$ca->address_type = $addressType;
|
|
|
|
|
|
|
|
if ($ca->find(true)) {
|
|
|
|
return $ca;
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
static function saveNew($user, $address, $addressType, $extra=null)
|
|
|
|
{
|
|
|
|
$ca = new Confirm_address();
|
|
|
|
|
|
|
|
if (!empty($user)) {
|
|
|
|
$ca->user_id = $user->id;
|
|
|
|
}
|
|
|
|
|
|
|
|
$ca->address = $address;
|
|
|
|
$ca->address_type = $addressType;
|
|
|
|
$ca->address_extra = $extra;
|
|
|
|
$ca->code = common_confirmation_code(64);
|
|
|
|
|
|
|
|
$ca->insert();
|
|
|
|
|
|
|
|
return $ca;
|
|
|
|
}
|
2008-06-20 14:15:36 +09:00
|
|
|
}
|