fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [15030] Syncromind: Merge 14936:15027 from trunk


From: sigurdne
Subject: [Fmsystem-commits] [15030] Syncromind: Merge 14936:15027 from trunk
Date: Fri, 13 May 2016 12:04:18 +0000 (UTC)

Revision: 15030
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15030
Author:   sigurdne
Date:     2016-05-13 12:04:18 +0000 (Fri, 13 May 2016)
Log Message:
-----------
Syncromind: Merge 14936:15027 from trunk

Modified Paths:
--------------
    branches/dev-syncromind-2/activitycalendar/inc/class.socommon.inc.php

Modified: branches/dev-syncromind-2/activitycalendar/inc/class.socommon.inc.php
===================================================================
--- branches/dev-syncromind-2/activitycalendar/inc/class.socommon.inc.php       
2016-05-13 12:04:15 UTC (rev 15029)
+++ branches/dev-syncromind-2/activitycalendar/inc/class.socommon.inc.php       
2016-05-13 12:04:18 UTC (rev 15030)
@@ -57,16 +57,16 @@
                {
                        if ($type == 'bool')
                        {
-                               return (boolean)$value;
+                               return (bool)$value;
                        }
+                       elseif ($type == 'int')
+                       {
+                               return (int)$value;
+                       }
                        elseif ($value === null || $value == 'NULL')
                        {
                                return null;
                        }
-                       elseif ($type == 'int')
-                       {
-                               return intval($value);
-                       }
                        elseif ($type == 'float')
                        {
                                return floatval($value);
@@ -106,7 +106,7 @@
                 */
                public function get_single( int $id )
                {
-                       $objects = $this->get(null, null, null, null, null, 
null, array($this->get_id_field_name() => $id));
+                       $objects = $this->get(0, 0, '', false, '', '', 
array($this->get_id_field_name() => $id));
                        if (count($objects) > 0)
                        {
                                $keys = array_keys($objects);
@@ -129,7 +129,7 @@
                 * @param $start_index int with index of first object.
                 * @param $num_of_objects int with max number of objects to 
return.
                 * @param $sort_field string representing the object field to 
sort on.
-                * @param $ascending boolean true for ascending sort on sort 
field, false
+                * @param $ascending bool true for ascending sort on sort 
field, false
                 * for descending.
                 * @param $search_for string with free text search query.
                 * @param $search_type string with the query type.
@@ -137,7 +137,7 @@
                 * @return array of objects. May return an empty
                 * array, never null. The array keys are the respective index 
numbers.
                 */
-               public function get( int $start_index, int $num_of_objects, 
string $sort_field, boolean $ascending, string $search_for, string 
$search_type, array $filters )
+               public function get( int $start_index, int $num_of_objects, 
string $sort_field, bool $ascending, string $search_for, string $search_type, 
array $filters )
                {
                        $results = array();   // Array to store result objects
                        $map = array(); // Array to hold number of records per 
target object
@@ -261,7 +261,7 @@
                 */
                public function get_count( string $search_for, string 
$search_type, array $filters )
                {
-                       return $this->get_query_count($this->get_query(null, 
null, $search_for, $search_type, $filters, true));
+                       return $this->get_query_count($this->get_query('', 
false, $search_for, $search_type, $filters, true));
                }
 
                /**
@@ -278,16 +278,16 @@
                 * @param $start_index int with index of first object.
                 * @param $num_of_objects int with max number of objects to 
return.
                 * @param $sort_field string representing the object field to 
sort on.
-                * @param $ascending boolean true for ascending sort on sort 
field, false
+                * @param $ascending bool true for ascending sort on sort 
field, false
                 * for descending.
                 * @param $search_for string with free text search query.
                 * @param $search_type string with the query type.
                 * @param $filters array with key => value of filters.
-                * @param $return_count boolean telling to return only the 
count of the
+                * @param $return_count bool telling to return only the count 
of the
                 * matching objects, or the objects themself.
                 * @return string with SQL.
                 */
-               protected abstract function get_query( string $sort_field, 
boolean $ascending, string $search_for, string $search_type, array $filters, 
boolean $return_count );
+               protected abstract function get_query( string $sort_field, bool 
$ascending, string $search_for, string $search_type, array $filters, bool 
$return_count );
 
                protected abstract function populate( int $object_id, &$object 
);
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]