[Cs-webapplibs-commits] SF.net SVN: cs-webapplibs:[185] trunk/0.3/abstract/cs_singleTableHandler. a
Status: Beta
Brought to you by:
crazedsanity
From: <cra...@us...> - 2010-09-02 14:35:36
|
Revision: 185 http://cs-webapplibs.svn.sourceforge.net/cs-webapplibs/?rev=185&view=rev Author: crazedsanity Date: 2010-09-02 14:35:30 +0000 (Thu, 02 Sep 2010) Log Message: ----------- Change protected functions into public ones for simplicity's sake. Modified Paths: -------------- trunk/0.3/abstract/cs_singleTableHandler.abstract.class.php Modified: trunk/0.3/abstract/cs_singleTableHandler.abstract.class.php =================================================================== --- trunk/0.3/abstract/cs_singleTableHandler.abstract.class.php 2010-09-01 14:12:57 UTC (rev 184) +++ trunk/0.3/abstract/cs_singleTableHandler.abstract.class.php 2010-09-02 14:35:30 UTC (rev 185) @@ -81,7 +81,7 @@ * @RETURN (int) SUCCESS: the (int) is the last inserted ID. * @EXCEPTION FAIL: exception indicates the error. */ - protected function create_record(array $data) { + public function create_record(array $data) { if(is_array($data) && count($data)) { $sql = 'INSERT INTO '. $this->tableName .' ' . $this->gfObj->string_from_array($data, 'insert', null, $this->cleanStringArr, true); @@ -110,7 +110,7 @@ * @RETURN (array) SUCCESS: list of field=>value of data from database. * @EXCEPTION FAIL: exception indicates the error. */ - protected function get_record_by_id($recId) { + public function get_record_by_id($recId) { if(is_numeric($recId)) { try { $data = $this->get_records(array($this->pkeyField => $recId)); @@ -137,7 +137,7 @@ * @RETURN (array) SUCCESS: returns single record with all fields. * @EXCEPTION FAIL: exception indicates error */ - protected function get_single_record(array $filter) { + public function get_single_record(array $filter) { if(is_array($filter) && count($filter)) { try { $data = $this->get_records($filter, null, 1); @@ -171,7 +171,7 @@ * @RETURN (array) SUCCESS: Primary index is the record ID, sub-array is same as returned by get_record_by_id(). * @EXCEPTION FAIL: exception indicates error. */ - protected function get_records(array $filter=null, $orderBy=null, $limit=null, $offset=null) { + public function get_records(array $filter=null, $orderBy=null, $limit=null, $offset=null) { $limitOffsetStr = ''; if(is_numeric($limit) && $limit > 0) { $limitOffsetStr = ' LIMIT '. $limit; @@ -221,7 +221,7 @@ * @RETURN (int) SUCCESS: (int) is the number of records updated (should always be 1) * @EXCEPTION FAIL: exception indicates the error. */ - protected function update_record($recId, array $updates, $removeEmptyVals=true) { + public function update_record($recId, array $updates, $removeEmptyVals=true) { if(is_numeric($recId) && $recId >= 0 && is_array($updates) && count($updates) > 0) { $updateString = $this->gfObj->string_from_array($updates, 'update', null, $this->cleanStringArr, $removeEmptyVals); if(is_null($updateString) || !strlen($updateString) || strlen($updateString) < 3) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |