Skip to content

Commit

Permalink
I dont call this programming, its more like document formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Dec 11, 2011
1 parent e9055bc commit 3b174c6
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 88 deletions.
6 changes: 2 additions & 4 deletions RedBean/Adapter/DBAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@
class RedBean_Adapter_DBAdapter extends RedBean_Observable implements RedBean_Adapter {

/**
* @var RedBean_Driver
*
* ADODB compatible class
* @var RedBean_Driver
*/
private $db = null;

/**
* @var string
*
* Contains SQL snippet
* @var string
*/
private $sql = "";

Expand Down
10 changes: 7 additions & 3 deletions RedBean/AssociationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,20 @@ public function __construct( RedBean_ToolBox $tools ) {

/**
* Creates a table name based on a types array.
* Manages the get the correct name for the linking table for the
* types provided.
*
* @param array $types types
* @todo find a nice way to decouple this class from QueryWriter?
*
* @param array $types 2 types as strings
*
* @return string $table table
*/
public function getTable( $types ) {
return RedBean_QueryWriter_AQueryWriter::getAssocTableFormat($types);
}
/**
* Associates two beans with eachother.
* Associates two beans with eachother using a many-to-many relation.
*
* @param RedBean_OODBBean $bean1 bean1
* @param RedBean_OODBBean $bean2 bean2
Expand All @@ -69,7 +73,7 @@ public function associate(RedBean_OODBBean $bean1, RedBean_OODBBean $bean2) {

/**
* Associates a pair of beans. This method associates two beans, no matter
* what types.
* what types.Accepts a base bean that contains data for the linking record.
*
* @param RedBean_OODBBean $bean1 first bean
* @param RedBean_OODBBean $bean2 second bean
Expand Down
21 changes: 8 additions & 13 deletions RedBean/Driver/PDO.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,66 +18,61 @@ class RedBean_Driver_PDO implements RedBean_Driver {


/**
* @var string
* Contains database DSN for connecting to database.
* @var string
*/
private $dsn;

/**
* @var boolean
* Whether we are in debugging mode or not.
* @var boolean
*/
private $debug = false;

/**
* @var PDO
* Holds the PDO instance.
* @var PDO
*/
private $pdo;

/**
* @var integer
* Holds integer number of affected rows from latest query
* if driver supports this feature.
* @var integer
*/
private $affected_rows;

/**
* @var resource
* Holds result resource.
* @var integer
*/
private $rs;


/**
* @var array
* Contains arbitrary connection data.
*
* @var array
*/
private $connectInfo = array();


/**
* @var bool
* Whether you want to use classic String Only binding -
* backward compatibility.
* @var bool
*/
public $flagUseStringOnlyBinding = false;

/**
*
* @var boolean
*
* Whether we are currently connected or not.
* This flag is being used to delay the connection until necessary.
* Delaying connections is a good practice to speed up scripts that
* don't need database connectivity but for some reason want to
* init RedbeanPHP.
* @var boolean
*/
private $isConnected = false;



/**
* Constructor. You may either specify dsn, user and password or
* just give an existing PDO connection.
Expand Down
2 changes: 1 addition & 1 deletion RedBean/Exception/SQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
class RedBean_Exception_SQL extends Exception {

/**
* @var string
* Holds the current SQL Strate code.
* @var string
*/
private $sqlState;

Expand Down
5 changes: 0 additions & 5 deletions RedBean/OODBBean.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class RedBean_OODBBean implements IteratorAggregate, ArrayAccess, Countable {

/**
* Reference to NULL property for magic getter.
*
* @var Null $null
*/
private $null = null;
Expand All @@ -25,31 +24,27 @@ class RedBean_OODBBean implements IteratorAggregate, ArrayAccess, Countable {
/**
* Properties of the bean. These are kept in a private
* array called properties and exposed through the array interface.
*
* @var array $properties
*/
private $properties = array();

/**
* Meta Data storage. This is the internal property where all
* Meta information gets stored.
*
* @var array
*/
private $__info = NULL;

/**
* Contains a BeanHelper to access service objects like
* te association manager and OODB.
*
* @var RedBean_BeanHelper
*/
private $beanHelper = NULL;

/**
* Contains the latest Fetch Type.
* A Fetch Type is a preferred type for the next nested bean.
*
* @var null
*/
private $fetchType = NULL;
Expand Down
14 changes: 5 additions & 9 deletions RedBean/QueryWriter/AQueryWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,33 @@
abstract class RedBean_QueryWriter_AQueryWriter {

/**
* @var type
* Scanned value (scanType)
* @var type
*/
protected $svalue;

/**
* @var array
* Supported Column Types.
* @var array
*/
public $typeno_sqltype = array();

/**
*
* @var RedBean_Adapter_DBAdapter
* Holds a reference to the database adapter to be used.
* @var RedBean_Adapter_DBAdapter
*/
protected $adapter;


/**
* @var string
* default value to for blank field (passed to PK for auto-increment)
* @var string
*/
protected $defaultValue = 'NULL';

/**
* @var string
* character to escape keyword table/column names
* @var string
*/
protected $quoteCharacter = '';

Expand Down Expand Up @@ -98,9 +97,6 @@ protected function getInsertSuffix ($table) {
return "";
}




/**
* Checks table name or column name.
*
Expand Down
43 changes: 15 additions & 28 deletions RedBean/QueryWriter/MySQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,101 +23,88 @@ class RedBean_QueryWriter_MySQL extends RedBean_QueryWriter_AQueryWriter impleme
*/

/**
* @var integer
*
* DATA TYPE
* Boolean Data type
* @var integer
*/
const C_DATATYPE_BOOL = 0;

/**
*
* @var integer
*
* DATA TYPE
* Unsigned 8BIT Integer
*
* @var integer
*/
const C_DATATYPE_UINT8 = 1;

/**
*
* @var integer
*
* DATA TYPE
* Unsigned 32BIT Integer
*
* @var integer
*/
const C_DATATYPE_UINT32 = 2;

/**
* @var integer
*
* DATA TYPE
* Double precision floating point number and
* negative numbers.
*
* @var integer
*/
const C_DATATYPE_DOUBLE = 3;

/**
* @var integer
*
* DATA TYPE
* Standard Text column (like varchar255)
* At least 8BIT character support.
*
* @var integer
*/
const C_DATATYPE_TEXT8 = 4;

/**
* @var integer
*
* DATA TYPE
* Long text column (16BIT)
*
* @var integer
*/
const C_DATATYPE_TEXT16 = 5;

/**
* @var integer
*
*
* DATA TYPE
* 32BIT long textfield (number of characters can be as high as 32BIT) Data type
* This is the biggest column that RedBean supports. If possible you may write
* an implementation that stores even bigger values.
*
* @var integer
*/
const C_DATATYPE_TEXT32 = 6;

/**
* @var integer
* Special type date for storing date values: YYYY-MM-DD
* @var integer
*/
const C_DATATYPE_SPECIAL_DATE = 80;

/**
* @var integer
* Special type datetime for store date-time values: YYYY-MM-DD HH:II:SS
* @var integer
*/
const C_DATATYPE_SPECIAL_DATETIME = 81;


/**
* @var integer
*
*
* DATA TYPE
* Specified. This means the developer or DBA
* has altered the column to a different type not
* recognized by RedBean. This high number makes sure
* it will not be converted back to another type by accident.
*
* @var integer
*/
const C_DATATYPE_SPECIFIED = 99;

/**
* @var integer
* Spatial types
* @var integer
*/
const C_DATATYPE_SPECIAL_POINT = 100;
const C_DATATYPE_SPECIAL_LINESTRING = 101;
Expand All @@ -128,14 +115,14 @@ class RedBean_QueryWriter_MySQL extends RedBean_QueryWriter_AQueryWriter impleme
const C_DATATYPE_SPECIAL_GEOMETRYCOLLECTION = 106;

/**
*
* Holds the RedBean Database Adapter.
* @var RedBean_Adapter_DBAdapter
*/
protected $adapter;

/**
* @var string
* character to escape keyword table/column names
* @var string
*/
protected $quoteCharacter = '`';

Expand Down
Loading

0 comments on commit 3b174c6

Please sign in to comment.