00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 include_once( "kernel/classes/ezpersistentobject.php" );
00042
00043 class eZUserAccountKey extends eZPersistentObject
00044 {
00045
00046
00047
00048 function eZUserAccountKey( $row = array() )
00049 {
00050 $this->eZPersistentObject( $row );
00051 }
00052
00053 function definition()
00054 {
00055 return array( "fields" => array( "id" => "ID",
00056 "user_id" => "UserID",
00057 "hash_key" => "HashKey",
00058 "time" => "Time"
00059 ),
00060 "keys" => array( "id" ),
00061 "increment_key" => "id",
00062 "sort" => array( "id" => "asc" ),
00063 "class_name" => "eZUserAccountKey",
00064 "name" => "ezuser_accountkey" );
00065 }
00066
00067 function createNew( $userID, $hashKey, $time)
00068 {
00069 return new eZUserAccountKey( array( "user_id" => $userID,
00070 "hash_key" => $hashKey,
00071 "time" => $time ) );
00072 }
00073
00074 function fetchByKey( $hashKey )
00075 {
00076 return eZPersistentObject::fetchObject( eZUserAccountKey::definition(),
00077 null,
00078 array( "hash_key" => $hashKey ),
00079 true );
00080 }
00081
00082
00083
00084
00085 function remove( $userID )
00086 {
00087 eZPersistentObject::removeObject( eZUserAccountKey::definition(),
00088 array( 'user_id' => $userID ) );
00089 }
00090
00091 }
00092
00093 ?>