Skip to content

Commit

Permalink
Clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
gabordemooij committed Mar 26, 2013
1 parent 93a9bf8 commit ff6b7de
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 69 deletions.
6 changes: 1 addition & 5 deletions RedBean/AssociationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,7 @@ public function areRelated(RedBean_OODBBean $bean1, RedBean_OODBBean $bean2) {
return (count($rows)>0);
}
/**
* Given an array of two beans and a property, this method
* swaps the value of the property.
* This is handy if you need to swap the priority or orderNo
* of an item (i.e. bug-tracking, page order).
*
* @deprecated
* @param array $beans beans
* @param string $property property
*/
Expand Down
23 changes: 0 additions & 23 deletions RedBean/Driver/OCI.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,60 +14,42 @@
* with this source code in the file license.txt.
*/
class RedBean_Driver_OCI implements RedBean_Driver {

/**
* Database connection string
* @var string
*/
private $dsn;

/**
*
* @var unknown_type
*/
private static $instance;

/**
*
* @var boolean
*/
private $debug = false;

/**
* Holds an instance of Logger implementation.
* @var RedBean_Logger
*/
protected $logger = NULL;
/**
* Number of affected rows for update/insert query.
* @var integer
*/
private $affected_rows;

/**
* Result storage.
* @var mixed
*/
private $rs;

/**
* Whether to automatically commit query or not.
* @var boolean
*/
private $autocommit = true;

/**
* Hold the statement for the last query.
* @var mixed
*/
private $statement;

/**
* Hold the last inserted Id for the last statement.
* @var mixed
*/
private $lastInsertedId;

/**
* Whether we are currently connected or not.
* This flag is being used to delay the connection until necessary.
Expand All @@ -77,27 +59,23 @@ class RedBean_Driver_OCI implements RedBean_Driver {
* @var boolean
*/
protected $isConnected = false;

/**
* OCI NLS date format.
* @var string
*/
private $nlsDateFormat = 'YYYY-MM-DD HH24:MI:SS';

/**
* OCI NLS date format.
* @var string
*/
private $nlsTimeStampFormat = 'YYYY-MM-DD HH24:MI:SS.FF';

/**
* OCI constants
*/
const OCI_NO_SUCH_TABLE = '942';
const OCI_NO_SUCH_COLUMN = '904';
const OCI_INTEGRITY_CONSTRAINT_VIOLATION = '2292';
const OCI_UNIQUE_CONSTRAINT_VIOLATION = '1';

/**
* Returns an instance of the OCI Driver.
* @param $dsn
Expand All @@ -112,7 +90,6 @@ public static function getInstance($dsn, $user, $pass) {
}
return self::$instance;
}

/**
* Constructor. You may either specify dsn, user and password or
* just give an existing OCI connection.
Expand Down
7 changes: 2 additions & 5 deletions RedBean/Facade.php
Original file line number Diff line number Diff line change
Expand Up @@ -656,11 +656,8 @@ public static function exportAll($beans, $parents=false, $filters=array()) {
return self::$duplicationManager->exportAll($beans, $parents, $filters);
}
/**
* Given an array of two beans and a property, this method
* swaps the value of the property.
* This is handy if you need to swap the priority or orderNo
* of an item (i.e. bug-tracking, page order).
*
* @deprecated
*
* @param array $beans beans
* @param string $property property
*/
Expand Down
5 changes: 0 additions & 5 deletions RedBean/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
*/
interface RedBean_Logger {
/**
* Method used to log messages.
* Writes the specified message to the log document whatever
* that may be (files, database etc). Provides a uniform
* interface for logging throughout RedBeanPHP.
*
* @param string $message the message to log. (optional)
*/
public function log();
Expand Down
5 changes: 0 additions & 5 deletions RedBean/ModelHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,14 @@
*/
class RedBean_ModelHelper implements RedBean_Observer {
/**
* Holds a model formatter
* @var RedBean_IModelFormatter
*/
private static $modelFormatter;
/**
* Holds a dependency injector
* @var type
*/
private static $dependencyInjector;
/**
* Cache for model names to avoid unnecessary
* reflections.
*
* @var array
*/
private static $modelCache = array();
Expand Down
12 changes: 2 additions & 10 deletions RedBean/OODBBean.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,14 @@
*/
class RedBean_OODBBean implements IteratorAggregate, ArrayAccess, Countable {
/**
* Flag indicates whether column names with CamelCase are supported and automatically
* converted; example: isForSale -> is_for_sale
* @var boolean
*/
private static $flagUseBeautyfulColumnnames = true;
/**
* Cache for so-called beautiful column names.
* @var array
*/
* @var array
*/
private static $beautifulColumns = array();
/**
* By default own-lists and shared-lists no longer have IDs as keys (3.3+),
* this is because exportAll also does not offer this feature and we want the
* ORM to be more consistent. Also, exporting without keys makes it easier to
* export lists to Javascript because unlike in PHP in JS arrays will fill up gaps.
*
* @var boolean
*/
private static $flagKeyedExport = false;
Expand Down
1 change: 0 additions & 1 deletion RedBean/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
*/
interface RedBean_Observer {
/**
* Part of the RedBean Observer Infrastructure.
* @param string $eventname
* @param RedBean_OODBBean mixed $info
*/
Expand Down
17 changes: 4 additions & 13 deletions RedBean/QueryWriter/AQueryWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,8 @@ public function selectRecord($type, $conditions, $addSql=null, $delete=null, $in
* @see RedBean_QueryWriter::wipe
*/
public function wipe($type) {
$table = $type;
$table = $this->esc($table);
$sql = "TRUNCATE $table ";
$this->adapter->exec($sql);
$table = $this->esc($type);
$this->adapter->exec("TRUNCATE $table ");
}
/**
* @see RedBean_QueryWriter::count
Expand All @@ -235,14 +233,7 @@ public function count($beanType, $addSQL = '', $params = array()) {
return (int) $this->adapter->getCell($sql.$addSQL,$params);
}
/**
* This is a utility service method publicly available.
* It allows you to check whether you can safely treat an certain value as an integer by
* comparing an int-valled string representation with a default string casted string representation and
* a ctype-digit check. It does not take into account numerical limitations (X-bit INT), just that it
* can be treated like an INT. This is useful for binding parameters to query statements like
* Query Writers and drivers can do.
*
* @static
* Checks whether a number can be treated like an int.
*
* @param string $value string representation of a certain value
*
Expand Down Expand Up @@ -386,7 +377,7 @@ public function flushCache() {
$this->cache = array();
}
/**
* Deprecated. Use esc() instead.
* @deprecated Use esc() instead.
*/
public function safeColumn($a, $b = false) { return $this->esc($a, $b); }
public function safeTable($a, $b = false) { return $this->esc($a, $b); }
Expand Down
2 changes: 0 additions & 2 deletions RedBean/TagManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public function findTagByTitle($title) {
return null;
}
/**
* Part of RedBeanPHP Tagging API.
* Tests whether a bean has been associated with one ore more
* of the listed tags. If the third parameter is TRUE this method
* will return TRUE only if all tags that have been specified are indeed
Expand Down Expand Up @@ -168,7 +167,6 @@ public function tagged($beanType, $tagList) {
return $collection;
}
/**
* Part of RedBeanPHP Tagging API.
* Returns all beans that have been tagged with ALL of the tags given.
*
* @param $beanType type of bean you are looking for
Expand Down

0 comments on commit ff6b7de

Please sign in to comment.