Overview

Packages

  • Kolab
    • Server

Classes

  • Horde_Kolab_Server_Composite
  • Horde_Kolab_Server_Connection_File
  • Horde_Kolab_Server_Connection_Mock
  • Horde_Kolab_Server_Connection_Mock_Ldap
  • Horde_Kolab_Server_Connection_Mock_Search
  • Horde_Kolab_Server_Connection_Simpleldap
  • Horde_Kolab_Server_Connection_Splittedldap
  • Horde_Kolab_Server_Decorator_Clean
  • Horde_Kolab_Server_Decorator_Count
  • Horde_Kolab_Server_Decorator_Log
  • Horde_Kolab_Server_Decorator_Map
  • Horde_Kolab_Server_Exception
  • Horde_Kolab_Server_Exception_Bindfailed
  • Horde_Kolab_Server_Exception_Novalue
  • Horde_Kolab_Server_Factory
  • Horde_Kolab_Server_Ldap
  • Horde_Kolab_Server_Ldap_Changes
  • Horde_Kolab_Server_Ldap_Filtered
  • Horde_Kolab_Server_Ldap_Standard
  • Horde_Kolab_Server_List_Base
  • Horde_Kolab_Server_Object_Attribute_Base
  • Horde_Kolab_Server_Object_Attribute_Createtimestamp
  • Horde_Kolab_Server_Object_Attribute_Createtimestampdate
  • Horde_Kolab_Server_Object_Attribute_Decorator
  • Horde_Kolab_Server_Object_Attribute_Default
  • Horde_Kolab_Server_Object_Attribute_Empty
  • Horde_Kolab_Server_Object_Attribute_External
  • Horde_Kolab_Server_Object_Attribute_Field
  • Horde_Kolab_Server_Object_Attribute_Firstnamelastname
  • Horde_Kolab_Server_Object_Attribute_Guid
  • Horde_Kolab_Server_Object_Attribute_Id
  • Horde_Kolab_Server_Object_Attribute_Internal
  • Horde_Kolab_Server_Object_Attribute_Locked
  • Horde_Kolab_Server_Object_Attribute_Modifytimestamp
  • Horde_Kolab_Server_Object_Attribute_Modifytimestampdate
  • Horde_Kolab_Server_Object_Attribute_Objectclass
  • Horde_Kolab_Server_Object_Attribute_Openldapaci
  • Horde_Kolab_Server_Object_Attribute_Required
  • Horde_Kolab_Server_Object_Attribute_Single
  • Horde_Kolab_Server_Object_Attribute_Value
  • Horde_Kolab_Server_Object_Attribute_Writelock
  • Horde_Kolab_Server_Object_Base
  • Horde_Kolab_Server_Object_Factory
  • Horde_Kolab_Server_Object_Groupofnames
  • Horde_Kolab_Server_Object_Hash
  • Horde_Kolab_Server_Object_Inetorgperson
  • Horde_Kolab_Server_Object_Kolab
  • Horde_Kolab_Server_Object_Kolab_Address
  • Horde_Kolab_Server_Object_Kolab_Administrator
  • Horde_Kolab_Server_Object_Kolab_Adminrole
  • Horde_Kolab_Server_Object_Kolab_Distlist
  • Horde_Kolab_Server_Object_Kolab_Domainmaintainer
  • Horde_Kolab_Server_Object_Kolab_Maintainer
  • Horde_Kolab_Server_Object_Kolab_User
  • Horde_Kolab_Server_Object_Kolabgermanbankarrangement
  • Horde_Kolab_Server_Object_Kolabgroupofnames
  • Horde_Kolab_Server_Object_Kolabinetorgperson
  • Horde_Kolab_Server_Object_Kolabpop3account
  • Horde_Kolab_Server_Object_Kolabsharedfolder
  • Horde_Kolab_Server_Object_Mcached
  • Horde_Kolab_Server_Object_Organizationalperson
  • Horde_Kolab_Server_Object_Person
  • Horde_Kolab_Server_Object_Top
  • Horde_Kolab_Server_Objects_Base
  • Horde_Kolab_Server_Query_Element_And
  • Horde_Kolab_Server_Query_Element_Approx
  • Horde_Kolab_Server_Query_Element_Begins
  • Horde_Kolab_Server_Query_Element_Contains
  • Horde_Kolab_Server_Query_Element_Ends
  • Horde_Kolab_Server_Query_Element_Equals
  • Horde_Kolab_Server_Query_Element_Greater
  • Horde_Kolab_Server_Query_Element_Group
  • Horde_Kolab_Server_Query_Element_Less
  • Horde_Kolab_Server_Query_Element_Mapped
  • Horde_Kolab_Server_Query_Element_Not
  • Horde_Kolab_Server_Query_Element_Or
  • Horde_Kolab_Server_Query_Element_Single
  • Horde_Kolab_Server_Query_Ldap
  • Horde_Kolab_Server_Result_Ldap
  • Horde_Kolab_Server_Schema_Base
  • Horde_Kolab_Server_Schema_Decorator_Cache
  • Horde_Kolab_Server_Search_Base
  • Horde_Kolab_Server_Search_Operation_Addressesforuidormail
  • Horde_Kolab_Server_Search_Operation_Attributes
  • Horde_Kolab_Server_Search_Operation_Base
  • Horde_Kolab_Server_Search_Operation_Children
  • Horde_Kolab_Server_Search_Operation_Constraint_Single
  • Horde_Kolab_Server_Search_Operation_Constraint_Strict
  • Horde_Kolab_Server_Search_Operation_Groupsformember
  • Horde_Kolab_Server_Search_Operation_Guid
  • Horde_Kolab_Server_Search_Operation_Guidforalias
  • Horde_Kolab_Server_Search_Operation_Guidforcn
  • Horde_Kolab_Server_Search_Operation_Guidforkolabusers
  • Horde_Kolab_Server_Search_Operation_Guidformail
  • Horde_Kolab_Server_Search_Operation_Guidformailoralias
  • Horde_Kolab_Server_Search_Operation_Guidforuid
  • Horde_Kolab_Server_Search_Operation_Guidforuidormail
  • Horde_Kolab_Server_Search_Operation_Guidforuidormailoralias
  • Horde_Kolab_Server_Search_Operation_Mailforuidormail
  • Horde_Kolab_Server_Search_Operation_Restrictgroups
  • Horde_Kolab_Server_Search_Operation_Restrictkolab
  • Horde_Kolab_Server_Structure_Attribute_Double
  • Horde_Kolab_Server_Structure_Attribute_Value
  • Horde_Kolab_Server_Structure_Base
  • Horde_Kolab_Server_Structure_Kolab
  • Horde_Kolab_Server_Structure_Ldap

Interfaces

  • Horde_Kolab_Server_Connection_Interface
  • Horde_Kolab_Server_Interface
  • Horde_Kolab_Server_List_Interface
  • Horde_Kolab_Server_Object_Attribute_Interface
  • Horde_Kolab_Server_Object_Interface
  • Horde_Kolab_Server_Object_Searches
  • Horde_Kolab_Server_Objects_Interface
  • Horde_Kolab_Server_Query_Element_Interface
  • Horde_Kolab_Server_Query_Interface
  • Horde_Kolab_Server_Result_Interface
  • Horde_Kolab_Server_Schema_Interface
  • Horde_Kolab_Server_Search_Interface
  • Horde_Kolab_Server_Search_Operation_Interface
  • Horde_Kolab_Server_Structure_Attribute_Interface
  • Horde_Kolab_Server_Structure_Interface
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Represents german bank account information.
  4:  *
  5:  * PHP version 5
  6:  *
  7:  * @category Kolab
  8:  * @package  Kolab_Server
  9:  * @author   Gunnar Wrobel <wrobel@pardus.de>
 10:  * @license  http://www.horde.org/licenses/lgpl21 LGPL 2.1
 11:  * @link     http://pear.horde.org/index.php?package=Kolab_Server
 12:  */
 13: 
 14: /**
 15:  * This class provides a representation of german bank account
 16:  * information.
 17:  *
 18:  * Copyright 2008-2012 Horde LLC (http://www.horde.org/)
 19:  *
 20:  * See the enclosed file COPYING for license information (LGPL). If you
 21:  * did not receive this file, see http://www.horde.org/licenses/lgpl21.
 22:  *
 23:  * @category Kolab
 24:  * @package  Kolab_Server
 25:  * @author   Gunnar Wrobel <wrobel@pardus.de>
 26:  * @license  http://www.horde.org/licenses/lgpl21 LGPL 2.1
 27:  * @link     http://pear.horde.org/index.php?package=Kolab_Server
 28:  */
 29: class Horde_Kolab_Server_Object_Kolabgermanbankarrangement extends Horde_Kolab_Server_Object_Top
 30: {
 31:     /** Define attributes specific to this object type */
 32: 
 33:     /** The number of the account */
 34:     const ATTRIBUTE_NUMBER = 'kolabGermanBankAccountNumber';
 35: 
 36:     /** The numeric ID of the bank */
 37:     const ATTRIBUTE_BANKCODE = 'kolabGermanBankCode';
 38: 
 39:     /** Account holder */
 40:     const ATTRIBUTE_HOLDER = 'kolabGermanBankAccountHolder';
 41: 
 42:     /** Name of the bank */
 43:     const ATTRIBUTE_BANKNAME = 'kolabGermanBankName';
 44: 
 45:     /** Additional information */
 46:     const ATTRIBUTE_INFO = 'kolabGermanBankAccountInfo';
 47: 
 48:     /** The uid of the owner of this account */
 49:     const ATTRIBUTE_OWNERUID = 'kolabGermanBankAccountOwnerUid';
 50: 
 51:     /** The specific object class of this object type */
 52:     const OBJECTCLASS_KOLABGERMANBANKARRANGEMENT = 'kolabGermanBankArrangement';
 53: 
 54:     /**
 55:      * A structure to initialize the attribute structure for this class.
 56:      *
 57:      * @var array
 58:      */
 59:     static public $init_attributes = array(
 60:         'defined' => array(
 61:             self::ATTRIBUTE_NUMBER,
 62:             self::ATTRIBUTE_BANKCODE,
 63:             self::ATTRIBUTE_HOLDER,
 64:             self::ATTRIBUTE_BANKNAME,
 65:             self::ATTRIBUTE_INFO,
 66:         ),
 67:         'derived' => array(
 68:             self::ATTRIBUTE_OWNERUID => array(
 69:                 'method' => 'getParentUid',
 70:                 'args' => array(
 71:                     2,
 72:                 ),
 73:             ),
 74:         ),
 75:         'collapsed' => array(
 76:             self::ATTRIBUTE_OWNERUID => array(
 77:                 'base' => array(
 78:                     self::ATTRIBUTE_OWNERUID
 79:                 ),
 80:                 'method' => 'removeAttribute',
 81:             ),
 82:         ),
 83:         'required' => array(
 84:             self::ATTRIBUTE_NUMBER,
 85:             self::ATTRIBUTE_BANKCODE,
 86:         ),
 87:         'object_classes' => array(
 88:             self::OBJECTCLASS_KOLABGERMANBANKARRANGEMENT,
 89:         ),
 90:     );
 91: 
 92:     /**
 93:      * Generates an ID for the given information.
 94:      *
 95:      * @param array &$info The data of the object.
 96:      *
 97:      * @static
 98:      *
 99:      * @return string|PEAR_Error The ID.
100:      */
101:     public function generateId(array &$info)
102:     {
103:         if (!isset($info[self::ATTRIBUTE_OWNERUID])) {
104:             $uid = $this->get(self::ATTRIBUTE_OWNERUID);
105:             if (empty($uid)) {
106:                 throw new Horde_Kolab_Server_Exception("No parent object provided!",
107:                                                        Horde_Kolab_Server_Exception::INVALID_INFORMATION);
108:             }
109:         } else {
110:             if (is_array($info[self::ATTRIBUTE_OWNERUID])) {
111:                 $uid = $info[self::ATTRIBUTE_OWNERUID][0];
112:             } else {
113:                 $uid = $info[self::ATTRIBUTE_OWNERUID];
114:             }
115:         }
116: 
117:         $object = $this->server->fetch($uid);
118:         if (!$object->exists()) {
119:             throw new Horde_Kolab_Server_Exception(sprintf("The parent object %s does not exist!",
120:                                                            $uid),
121:                                                    Horde_Kolab_Server_Exception::INVALID_INFORMATION);
122:         }
123: 
124:         if (!isset($info[self::ATTRIBUTE_NUMBER])) {
125:             $number = $this->get(self::ATTRIBUTE_NUMBER);
126:             if (empty($number)) {
127:                 throw new Horde_Kolab_Server_Exception("No account number given!",
128:                                                        Horde_Kolab_Server_Exception::INVALID_INFORMATION);
129:             }
130:         } else {
131:             if (is_array($info[self::ATTRIBUTE_NUMBER])) {
132:                 $number = $info[self::ATTRIBUTE_NUMBER][0];
133:             } else {
134:                 $number = $info[self::ATTRIBUTE_NUMBER];
135:             }
136:         }
137: 
138:         if (!isset($info[self::ATTRIBUTE_BANKCODE])) {
139:             $bankcode = $this->get(self::ATTRIBUTE_BANKCODE);
140:             if (empty($bankcode)) {
141:                 throw new Horde_Kolab_Server_Exception("No bankcode given!",
142:                                                        Horde_Kolab_Server_Exception::INVALID_INFORMATION);
143:             }
144:         } else {
145:             if (is_array($info[self::ATTRIBUTE_BANKCODE])) {
146:                 $bankcode = $info[self::ATTRIBUTE_BANKCODE][0];
147:             } else {
148:                 $bankcode = $info[self::ATTRIBUTE_BANKCODE];
149:             }
150:         }
151: 
152:         $base = substr($uid, 0, strpos($uid, $this->server->getBaseUid()) - 1);
153: 
154:         unset($info[self::ATTRIBUTE_OWNERUID]);
155: 
156:         return self::ATTRIBUTE_NUMBER . '=' . $this->server->structure->quoteForUid($number) . ',' 
157:             . self::ATTRIBUTE_BANKCODE . '=' . $this->server->structure->quoteForUid($bankcode) . ','
158:             . $base;
159:     }
160: 
161:     /**
162:      * Returns the set of search operations supported by this object type.
163:      *
164:      * @return array An array of supported search operations.
165:      */
166:     static public function getSearchOperations()
167:     {
168:         $searches = array(
169: /*             'accountsForMail', */
170:         );
171:         return $searches;
172:     }
173: 
174:     /**
175:      * Returns the UIDs of the bank accounts for the user with the given mail
176:      * address.
177:      *
178:      * @param Horde_Kolab_Server $server The server to query.
179:      * @param string             $mail   Search objects with this mail alias.
180:      *
181:      * @return mixed The UIDs or false if there was no result.
182:      *
183:      * @throws Horde_Kolab_Server_Exception
184:      */
185:     static public function accountsForMail($server, $mail)
186:     {
187:         $uid = $server->uidForMail($mail, Horde_Kolab_Server_Object::RESULT_SINGLE);
188:         return self::objectsForUid($server, $uid, self::OBJECTCLASS_KOLABGERMANBANKARRANGEMENT);
189:     }
190: 
191: }
API documentation generated by ApiGen