PHP Class Pommo_Subscribers, poMMo

== Additional columns for Pending == pending_id (int) Database ID/Key subscriber_id (int) Subscriber ID in subscribers table pending_code (str) Code to complete pending request pending_type (enum) 'add','del','change','password',NULL (def: null) pending_array (str) Serialized Subscriber object (for update) == Additional Data Columns == data_id (int) Database ID/Key field_id (int) Field ID in fields table subscriber_id (int) Subscriber ID in subscribers table value (str) Subscriber's field value
ファイルを表示 Open project: soonick/poMMo Class Usage Examples

Public Methods

Method Description
add ( $in, $id = null ) as a means for UPDATE?
delete ( &$id ) returns the # of deleted subscribers (int). 0 (false) if none.
flagByID ( &$id ) returns the # of subscribers successfully flagged (int). 0 (false) if none.
get ( $p = [], $search = ['field' => null, 'string' => null] ) returns an array of subscribers. Array key(s) correlates to subscriber id.
getActCode ( $subscriber ) returns the activation code for the passed subscriber
getEmail ( $p = [] ) returns an array of emails. Array key(s) correlates to subscriber id.
getIDByAttr ( $f = ['subscriber_pending' => [], 'subscriber_data' => [], 'subscribers' => []] ) EXAMPLE array( 'subscriber_pending' => array( 'pending_code' => array("not: 'abc1234'", "is: 'def123'", "is: '2234'"), 'pending_email' => array('not: NULL')), 'subscriber_data' => array( 12 => array("not: 'Milwaukee'"), // 12 is alias for field_id=12 .
getIDByEmail ( $email, $status = null ) returns an array of subscriber IDs
getSubscribersHits ( $mailing ) : array Returns all the subscribers in the database and if they have opened the passed mailing id
make ( $in = [], $pending = FALSE ) return a subscriber object (array)
makeDB ( &$row, $pending = FALSE ) return a subscriber object (array)
tally ( $status = 1 ) returns subscriber tally (int)
update ( &$in, $mode = 'REPLACE_PASSED' ) Does not change the subscriber_id --> paves the path to add manually assign subs to a group?
validate ( &$in ) NOTE: has the magic functionality of converting english status to bool equiv.

Method Details

add() public static method

as a means for UPDATE?
public static add ( $in, $id = null )

delete() public method

returns the # of deleted subscribers (int). 0 (false) if none.
public delete ( &$id )

flagByID() public method

returns the # of subscribers successfully flagged (int). 0 (false) if none.
public flagByID ( &$id )

get() public static method

returns an array of subscribers. Array key(s) correlates to subscriber id.
public static get ( $p = [], $search = ['field' => null, 'string' => null] )

getActCode() public static method

returns the activation code for the passed subscriber
public static getActCode ( $subscriber )

getEmail() public method

returns an array of emails. Array key(s) correlates to subscriber id.
public getEmail ( $p = [] )

getIDByAttr() public method

.. 15 => array("greater: 15")), 'subscribers' => array( 'email' => "not: '[email protected]'"), 'status' => "equal: active" ); LEGAL LOGIC: (not|is|less|greater|true|false|equal)
public getIDByAttr ( $f = ['subscriber_pending' => [], 'subscriber_data' => [], 'subscribers' => []] )

getIDByEmail() public method

returns an array of subscriber IDs
public getIDByEmail ( $email, $status = null )

getSubscribersHits() public method

Returns all the subscribers in the database and if they have opened the passed mailing id
public getSubscribersHits ( $mailing ) : array
return array $subscribers.- Subscribers and if they have opened mailing

make() public method

return a subscriber object (array)
public make ( $in = [], $pending = FALSE )

makeDB() public static method

return a subscriber object (array)
public static makeDB ( &$row, $pending = FALSE )

tally() static public method

returns subscriber tally (int)
static public tally ( $status = 1 )

update() public method

Does not change the subscriber_id --> paves the path to add manually assign subs to a group?
public update ( &$in, $mode = 'REPLACE_PASSED' )

validate() public static method

NOTE: has the magic functionality of converting english status to bool equiv.
public static validate ( &$in )