[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [15125] Syncromind: Merge 14936:15027 from trunk
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [15125] Syncromind: Merge 14936:15027 from trunk |
Date: |
Fri, 13 May 2016 12:24:37 +0000 (UTC) |
Revision: 15125
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15125
Author: sigurdne
Date: 2016-05-13 12:24:37 +0000 (Fri, 13 May 2016)
Log Message:
-----------
Syncromind: Merge 14936:15027 from trunk
Modified Paths:
--------------
branches/dev-syncromind-2/rental/inc/class.socommon.inc.php
Modified: branches/dev-syncromind-2/rental/inc/class.socommon.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.socommon.inc.php 2016-05-13
12:24:34 UTC (rev 15124)
+++ branches/dev-syncromind-2/rental/inc/class.socommon.inc.php 2016-05-13
12:24:37 UTC (rev 15125)
@@ -23,7 +23,7 @@
/**
* Begin transaction
*
- * @return integer|boolean current transaction id
+ * @return integer|bool current transaction id
*/
public function transaction_begin()
{
@@ -33,7 +33,7 @@
/**
* Complete the transaction
*
- * @return boolean True if sucessful, False if fails
+ * @return bool True if sucessful, False if fails
*/
public function transaction_commit()
{
@@ -43,7 +43,7 @@
/**
* Rollback the current transaction
*
- * @return boolean True if sucessful, False if fails
+ * @return bool True if sucessful, False if fails
*/
public function transaction_abort()
{
@@ -91,16 +91,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);
@@ -140,7 +140,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);
@@ -163,7 +163,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.
@@ -171,7 +171,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
@@ -347,7 +347,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));
}
/**
@@ -364,16 +364,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
);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [15125] Syncromind: Merge 14936:15027 from trunk,
sigurdne <=