CODE STYLE fixing propel autogenerated classes
This commit is contained in:
@@ -808,7 +808,7 @@ abstract class ".$this->getClassname()." extends ".ClassTools::classname($this->
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @return an associative array containing the field names (as keys) and field values
|
||||
*/
|
||||
public function toArray(\$keyType=BasePeer::TYPE_PHPNAME)
|
||||
public function toArray(\$keyType = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
\$keys = ".$this->getPeerClassname()."::getFieldNames(\$keyType);
|
||||
\$result = array(";
|
||||
@@ -835,7 +835,7 @@ abstract class ".$this->getClassname()." extends ".ClassTools::classname($this->
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @return mixed Value of field.
|
||||
*/
|
||||
public function getByName(\$name, \$type=BasePeer::TYPE_PHPNAME)
|
||||
public function getByName(\$name, \$type = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
\$pos = ".$this->getPeerClassname()."::translateFieldName(\$name, \$type, BasePeer::TYPE_NUM);
|
||||
return \$this->getByPosition(\$pos);
|
||||
@@ -890,7 +890,7 @@ $script .= "
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @return void
|
||||
*/
|
||||
public function setByName(\$name, \$value, \$type=BasePeer::TYPE_PHPNAME)
|
||||
public function setByName(\$name, \$value, \$type = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
\$pos = ".$this->getPeerClassname()."::translateFieldName(\$name, \$type, BasePeer::TYPE_NUM);
|
||||
return \$this->setByPosition(\$pos, \$value);
|
||||
@@ -949,7 +949,7 @@ $script .= "
|
||||
* @param string \$keyType The type of keys the array uses.
|
||||
* @return void
|
||||
*/
|
||||
public function fromArray(\$arr, \$keyType=BasePeer::TYPE_PHPNAME)
|
||||
public function fromArray(\$arr, \$keyType = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
\$keys = ".$this->getPeerClassname()."::getFieldNames(\$keyType);
|
||||
";
|
||||
@@ -981,7 +981,7 @@ $script .= "
|
||||
* @see BaseObject::setDeleted()
|
||||
* @see BaseObject::isDeleted()
|
||||
*/
|
||||
public function delete(\$con=null)
|
||||
public function delete(\$con = null)
|
||||
{
|
||||
if (\$this->isDeleted()) {
|
||||
throw new PropelException(\"This object has already been deleted.\");
|
||||
@@ -1115,7 +1115,7 @@ $script .= "
|
||||
public function validate(\$columns = null)
|
||||
{
|
||||
if (\$columns) {
|
||||
return ".$this->getPeerClassname()."::doValidate(\$this, \$columns);
|
||||
return ".$this->getPeerClassname()."::doValidatefromArray(\$this, \$columns);
|
||||
}
|
||||
return ".$this->getPeerClassname()."::doValidate(\$this);
|
||||
}
|
||||
|
||||
@@ -115,8 +115,7 @@ abstract class ".$this->getClassname()."
|
||||
*/
|
||||
protected function addClassClose(&$script)
|
||||
{
|
||||
$script .= "
|
||||
}
|
||||
$script .= "}
|
||||
|
||||
";
|
||||
$this->addStaticMapBuilderRegistration($script);
|
||||
@@ -297,7 +296,7 @@ if (Propel::isInit()) {
|
||||
* @return array A list of field names
|
||||
*/
|
||||
|
||||
static public function getFieldNames(\$type=BasePeer::TYPE_PHPNAME)
|
||||
static public function getFieldNames(\$type = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
if (!array_key_exists(\$type, self::\$fieldNames)) {
|
||||
throw new PropelException('Method getFieldNames() expects the parameter \$type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . \$type . ' was given.');
|
||||
@@ -528,7 +527,7 @@ if (Propel::isInit()) {
|
||||
* @param Connection \$con
|
||||
* @return int Number of matching rows.
|
||||
*/
|
||||
public static function doCount(Criteria \$criteria, \$distinct=false, \$con=null)
|
||||
public static function doCount(Criteria \$criteria, \$distinct = false, \$con = null)
|
||||
{
|
||||
// we're going to modify criteria, so copy it first
|
||||
\$criteria = clone \$criteria;
|
||||
@@ -572,7 +571,7 @@ if (Propel::isInit()) {
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelectOne(Criteria \$criteria, \$con=null)
|
||||
public static function doSelectOne(Criteria \$criteria, \$con = null)
|
||||
{
|
||||
\$critcopy = clone \$criteria;
|
||||
\$critcopy->setLimit(1);
|
||||
@@ -600,7 +599,7 @@ if (Propel::isInit()) {
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelect(Criteria \$criteria, \$con=null)
|
||||
public static function doSelect(Criteria \$criteria, \$con = null)
|
||||
{
|
||||
return ".$this->getPeerClassname()."::populateObjects(".$this->getPeerClassname()."::doSelectRS(\$criteria, \$con));
|
||||
}";
|
||||
@@ -628,7 +627,7 @@ if (Propel::isInit()) {
|
||||
* @return ResultSet The resultset object with numerically-indexed fields.
|
||||
* @see ".$this->basePeerClassname."::doSelect()
|
||||
*/
|
||||
public static function doSelectRS(Criteria \$criteria, \$con=null)
|
||||
public static function doSelectRS(Criteria \$criteria, \$con = null)
|
||||
{
|
||||
if (\$con === null) {
|
||||
\$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
@@ -835,7 +834,7 @@ if (Propel::isInit()) {
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert(\$values, \$con=null)
|
||||
public static function doInsert(\$values, \$con = null)
|
||||
{
|
||||
if (\$con === null) {
|
||||
\$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
@@ -894,7 +893,7 @@ if (Propel::isInit()) {
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doUpdate(\$values, \$con=null)
|
||||
public static function doUpdate(\$values, \$con = null)
|
||||
{
|
||||
if (\$con === null) {
|
||||
\$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
@@ -941,7 +940,7 @@ if (Propel::isInit()) {
|
||||
*
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(\$con=null)
|
||||
public static function doDeleteAll(\$con = null)
|
||||
{
|
||||
if (\$con === null) {
|
||||
\$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
@@ -991,7 +990,7 @@ if (Propel::isInit()) {
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete(\$values, \$con=null)
|
||||
public static function doDelete(\$values, \$con = null)
|
||||
{
|
||||
if (\$con === null) {
|
||||
\$con = Propel::getConnection(".$this->getPeerClassname()."::DATABASE_NAME);
|
||||
@@ -1265,7 +1264,7 @@ if (Propel::isInit()) {
|
||||
*
|
||||
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
|
||||
*/
|
||||
public static function doValidate(".$table->getPhpName()." \$obj, \$cols=null)
|
||||
public static function doValidate(".$table->getPhpName()." \$obj, \$cols = null)
|
||||
{
|
||||
\$columns = array();
|
||||
|
||||
@@ -1318,7 +1317,7 @@ if (Propel::isInit()) {
|
||||
* @param Connection \$con the connection to use
|
||||
* @return " . $table->getPhpName() . "
|
||||
*/
|
||||
public static function ".$this->getRetrieveMethodName()."(\$pk, \$con=null)
|
||||
public static function ".$this->getRetrieveMethodName()."(\$pk, \$con = null)
|
||||
{
|
||||
if (\$con === null) {
|
||||
\$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
@@ -1368,7 +1367,7 @@ if (Propel::isInit()) {
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function ".$this->getRetrieveMethodName()."s(\$pks, \$con=null)
|
||||
public static function ".$this->getRetrieveMethodName()."s(\$pks, \$con = null)
|
||||
{
|
||||
if (\$con === null) {
|
||||
\$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
@@ -1428,7 +1427,7 @@ if (Propel::isInit()) {
|
||||
$script .= "* @param $cptype $".$clo."
|
||||
";
|
||||
}
|
||||
$script .= " * @param Connection \$con
|
||||
$script .= " * @param Connection \$con
|
||||
* @return ".$table->getPhpName()."
|
||||
*/
|
||||
public static function ".$this->getRetrieveMethodName()."(";
|
||||
@@ -1437,7 +1436,7 @@ if (Propel::isInit()) {
|
||||
$clo = strtolower($col->getName());
|
||||
$script .= ($co++ ? ", " : "") . "$".$clo;
|
||||
} /* foreach */
|
||||
$script .= ", \$con=null)
|
||||
$script .= ", \$con = null)
|
||||
{
|
||||
if (\$con === null) {
|
||||
\$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
@@ -1452,7 +1451,8 @@ if (Propel::isInit()) {
|
||||
\$v = ".$this->getPeerClassname()."::doSelect(\$criteria, \$con);
|
||||
|
||||
return !empty(\$v) ? \$v[0] : null;
|
||||
}";
|
||||
}
|
||||
";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user