Operator: Add PHP5 class syntax
authorBen Klang <ben@alkaloid.net>
Tue, 12 Jan 2010 20:25:37 +0000 (15:25 -0500)
committerBen Klang <ben@alkaloid.net>
Tue, 12 Jan 2010 23:01:45 +0000 (18:01 -0500)
operator/lib/Driver.php
operator/lib/Driver/asterisksql.php
operator/lib/Form/SearchCDR.php

index 69ea0af..8069df8 100644 (file)
@@ -23,7 +23,7 @@ class Operator_Driver {
      *                actual call records.
      * @throws Operator_Exception
      */
-    function getRecords($start, $end, $accountcode = null, $dcontext = null,
+    public function getRecords($start, $end, $accountcode = null, $dcontext = null,
                          $rowstart = 0, $rowlimit = 100)
     {
         // Start Date
@@ -74,7 +74,7 @@ class Operator_Driver {
      *                              statistics for calls placed that month.
      * @throws Operator_Exception|Horde_Date_Exception
      */
-    function getMonthlyCallStats($start, $end, $accountcode = null,
+    public function getMonthlyCallStats($start, $end, $accountcode = null,
                                  $dcontext = null){
         if (empty($accountcode) || $accountcode == '%') {
             $permentry = 'operator:accountcodes';
@@ -108,7 +108,7 @@ class Operator_Driver {
      * @return Operator_Driver  The newly created concrete Operator_Driver
      *                          instance, or false on an error.
      */
-    function factory($driver = null, $params = null)
+    public function factory($driver = null, $params = null)
     {
         if ($driver === null) {
             $driver = $GLOBALS['conf']['storage']['driver'];
index f587766..80d50c5 100644 (file)
@@ -37,14 +37,14 @@ class Operator_Driver_asterisksql extends Operator_Driver {
      *
      * @var array
      */
-    var $_params = array();
+    protected $_params = array();
 
     /**
      * Handle for the current database connection.
      *
      * @var DB
      */
-    var $_db;
+    protected $_db;
 
     /**
      * Handle for the current database connection, used for writing. Defaults
@@ -52,21 +52,21 @@ class Operator_Driver_asterisksql extends Operator_Driver {
      *
      * @var DB
      */
-    var $_write_db;
+    protected $_write_db;
 
     /**
      * Boolean indicating whether or not we're connected to the SQL server.
      *
      * @var boolean
      */
-    var $_connected = false;
+    protected $_connected = false;
 
     /**
      * Constructs a new SQL storage object.
      *
      * @param array $params  A hash containing connection parameters.
      */
-    function Operator_Driver_asterisksql($params = array())
+    public function __construct($params = array())
     {
         $this->_params = $params;
     }
@@ -78,7 +78,7 @@ class Operator_Driver_asterisksql extends Operator_Driver {
      *                actual call records.
      * @throws Operator_Exception|Horde_Date_Exception
      */
-    function _getRecords($start, $end, $accountcode = null, $dcontext = null,
+    protected function _getRecords($start, $end, $accountcode = null, $dcontext = null,
                          $rowstart = 0, $rowlimit = 100)
     {
 
@@ -175,7 +175,7 @@ class Operator_Driver_asterisksql extends Operator_Driver {
      *                              statistics for calls placed that month.
      * @throws Operator_Exception|Horde_Date_Exception
      */
-    function _getMonthlyCallStats($start, $end, $accountcode = null,
+    protected function _getMonthlyCallStats($start, $end, $accountcode = null,
                                  $dcontext = null)
     {
         if (!is_a($start, 'Horde_Date') || !is_a($end, 'Horde_Date')) {
@@ -323,7 +323,7 @@ class Operator_Driver_asterisksql extends Operator_Driver {
         return $stats;
     }
 
-    function getAccountCodes()
+    public function getAccountCodes()
     {
         /* Make sure we have a valid database connection. */
         $this->_connect();
@@ -345,7 +345,7 @@ class Operator_Driver_asterisksql extends Operator_Driver {
      *
      * @return boolean  True on success; exits (Horde::fatal()) on error.
      */
-    function _connect()
+    protected function _connect()
     {
         if ($this->_connected) {
             return true;
@@ -414,7 +414,7 @@ class Operator_Driver_asterisksql extends Operator_Driver {
      *
      * @return boolean  True on success, false on failure.
      */
-    function _disconnect()
+    protected function _disconnect()
     {
         if ($this->_connected) {
             $this->_connected = false;
index d54fc70..261c73e 100644 (file)
@@ -15,7 +15,7 @@
 
 class SearchCDRForm extends Horde_Form {
 
-    function SearchCDRForm($title, &$vars)
+    public function __construct($title, &$vars)
     {
         parent::Horde_Form($vars, $title);