Overview
  • Namespace
  • Class

Namespaces

  • rpf
    • api
      • module
    • extension
      • module
    • system
      • module

Classes

  • rpf\api\api
  • rpf\api\apiModule
  • rpf\api\bbRpc
  • rpf\api\module\bbCustomer_getFreeOrdNr
  • rpf\api\module\bbCustomer_readAddress
  • rpf\api\module\bbCustomer_readDiscount
  • rpf\api\module\bbCustomer_readEntry
  • rpf\api\module\bbCustomer_readPayment
  • rpf\api\module\bbCustomer_readTitle
  • rpf\api\module\bbCustomer_saveAdress
  • rpf\api\module\bbCustomer_validateAddress
  • rpf\api\module\bbCustomer_validateEntry
  • rpf\api\module\bbCustomer_validatePayinfo
  • rpf\api\module\bbDomain_readEntry
  • rpf\api\module\bbDomain_readFrontpage
  • rpf\api\module\bbDomain_readHandles
  • rpf\api\module\bbDomain_readPhpini
  • rpf\api\module\bbDomain_readSettings
  • rpf\api\module\bbDomain_readSubdomain
  • rpf\api\module\bbDomain_readWebalizerSettings
  • rpf\api\module\bbDomain_searchEntry
  • rpf\api\module\bbEmail_readAccount
  • rpf\api\module\bbMysql_inuseEntry
  • rpf\api\module\bbMysql_makeBackup
  • rpf\api\module\bbMysql_readEntry
  • rpf\api\module\bbOrder_readAccountAddress
  • rpf\api\module\bbOrder_readAccountEntry
  • rpf\api\module\bbOrder_readDisposition
  • rpf\api\module\bbOrder_readEntry
  • rpf\api\module\bbQuota_readEntry
  • rpf\api\module\customer
  • rpf\api\module\email
  • rpf\api\module\order
  • rpf\api\module\placeholder
  • rpf\api\module\user
  • rpf\extension\extension
  • rpf\extension\extensionModule
  • rpf\extension\invoiceTextExport
  • rpf\extension\mailExport
  • rpf\extension\module\domainExport
  • rpf\extension\module\index
  • rpf\extension\module\mgntRatioExport
  • rpf\system\module
  • rpf\system\module\log
  • rpf\system\module\moduleManager
  • rpf\system\rpf

Exceptions

  • rpf\system\module\exception
  1 <?php namespace rpf\api\module;
  2 
  3 use rpf\api\apiModule;
  4 
  5 require_once __DIR__.'/../apiModule.php';
  6 
  7 /**
  8  * RP2-API-Module email
  9  *
 10  * @package system\module
 11  */
 12 class email extends apiModule
 13 {
 14     /**
 15      * Loads all email-accounts from a given order-id (oeid)
 16      *
 17      * @param (int|array) $oeids
 18      * @return $this
 19      * @throws \Exception
 20      */
 21     public function loadByOeid($oeids)
 22     {
 23         if (is_int($oeids))
 24         {
 25             $oeids[] = $oeids;
 26         }
 27 
 28         if (!is_array($oeids))
 29         {
 30             throw new \Exception(__CLASS__.'::'.__METHOD__.' expects an array, '.gettype($oeids).' given.');
 31         }
 32 
 33         foreach($oeids as $oeid)
 34         {
 35             if (!is_int($oeid))
 36             {
 37                 throw new \Exception(__CLASS__.'::'.__METHOD__.' expects an int-array, '.gettype($oeid).' in array given.');
 38             }
 39             $this->orders[$oeid] = $this->system->call('bbEmail::readAccount', ['oeid' => $oeid, 'return_array' => 1]);
 40         }
 41         return $this;
 42     }
 43 
 44     public function loadAll($param = false, $runOnce = true)
 45     {
 46         if ($runOnce && !$this->runOnce(__METHOD__)) return $this;
 47 
 48         if ($oeid == false && $param == false)
 49         {
 50             $this->data = $this->system->call('bbEmail::readAccount', ['return_array' => 1]);
 51         }
 52         else
 53         {
 54             throw new \Exception(__METHOD__."($oeid, $param, $runOnce) is not implemented yet", 501);
 55         }
 56 
 57         return $this;
 58     }
 59 
 60     /**
 61      * Counts all set  email-addresses per order
 62      *
 63      * @param (int|array|bool) $oeid
 64      * @param bool $runOnce
 65      * @return $this
 66      * @throws \Exception
 67      */
 68     public function loadOrderMailCount($oeid = false, $runOnce = true)
 69     {
 70         if ($runOnce && !$this->runOnce(__METHOD__)) return $this;
 71 
 72         if ($oeid !== false)
 73         {
 74             // TODO: implement int+array
 75             throw new \Exception("Not implemented yet", 501);
 76         }
 77 
 78         $result = $this->system->call('bbEmail::readAccount', ['return_array' => 1]);
 79 
 80         foreach ($result as &$row)
 81         {
 82             if (!isset($this->orders[$row['oeid']]['mail_addresses']))
 83             {
 84                 $this->orders[$row['oeid']]['mail_addresses'] = 1;
 85             }
 86             else
 87             {
 88                 $this->orders[$row['oeid']]['mail_addresses']++;
 89             }
 90         }
 91         return $this;
 92     }
 93 
 94     /**
 95      * Return all loaded e-mail-addresses indexed by order-id
 96      *
 97      * @return array[123] = array (...)
 98      */
 99     public function getIndexedByOrderId()
100     {
101         if (!is_array($this->data) || empty($this->data))
102         {
103             return array();
104         }
105         else
106         {
107             foreach ($this->data as &$row) {
108                 $return[$row['oeid']] = &$row;
109             }
110             return $return;
111         }
112     }
113 
114     /**
115      * Return all loaded e-mail-addresses indexed by e-mail-address
116      *
117      * @return array['some@mail.com'] = array(...)
118      */
119     public function getIndexedByEmail()
120     {
121         if (!is_array($this->data) || empty($this->data))
122         {
123             return array();
124         }
125         else
126         {
127             foreach ($this->data as &$row) {
128                 // TODO Implement
129                 $return[$row['xxxx']] = &$row;
130             }
131             return $return;
132         }
133     }
134 
135 
136 
137 
138 }
API documentation generated by ApiGen