Skip to content

Commit

Permalink
improper naming of propel tables in php caused cc_mount_name to not g…
Browse files Browse the repository at this point in the history
…et any generated files, double declaration of some variables for cc_timestamp.
  • Loading branch information
naomiaro committed Aug 28, 2013
1 parent 465da24 commit 9698898
Show file tree
Hide file tree
Showing 14 changed files with 2,159 additions and 73 deletions.
7 changes: 7 additions & 0 deletions airtime_mvc/application/configs/classmap-airtime-conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,13 @@
'BaseCcWebstreamMetadataPeer' => 'airtime/om/BaseCcWebstreamMetadataPeer.php',
'BaseCcWebstreamMetadata' => 'airtime/om/BaseCcWebstreamMetadata.php',
'BaseCcWebstreamMetadataQuery' => 'airtime/om/BaseCcWebstreamMetadataQuery.php',
'CcMountNameTableMap' => 'airtime/map/CcMountNameTableMap.php',
'CcMountNamePeer' => 'airtime/CcMountNamePeer.php',
'CcMountName' => 'airtime/CcMountName.php',
'CcMountNameQuery' => 'airtime/CcMountNameQuery.php',
'BaseCcMountNamePeer' => 'airtime/om/BaseCcMountNamePeer.php',
'BaseCcMountName' => 'airtime/om/BaseCcMountName.php',
'BaseCcMountNameQuery' => 'airtime/om/BaseCcMountNameQuery.php',
'CcTimestampTableMap' => 'airtime/map/CcTimestampTableMap.php',
'CcTimestampPeer' => 'airtime/CcTimestampPeer.php',
'CcTimestamp' => 'airtime/CcTimestamp.php',
Expand Down
18 changes: 18 additions & 0 deletions airtime_mvc/application/models/airtime/CcMountName.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php



/**
* Skeleton subclass for representing a row from the 'cc_mount_name' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package propel.generator.airtime
*/
class CcMountName extends BaseCcMountName {

} // CcMountName
18 changes: 18 additions & 0 deletions airtime_mvc/application/models/airtime/CcMountNamePeer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php



/**
* Skeleton subclass for performing query and update operations on the 'cc_mount_name' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package propel.generator.airtime
*/
class CcMountNamePeer extends BaseCcMountNamePeer {

} // CcMountNamePeer
18 changes: 18 additions & 0 deletions airtime_mvc/application/models/airtime/CcMountNameQuery.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php



/**
* Skeleton subclass for performing query and update operations on the 'cc_mount_name' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package propel.generator.airtime
*/
class CcMountNameQuery extends BaseCcMountNameQuery {

} // CcMountNameQuery
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function initialize()
public function buildRelations()
{
$this->addRelation('CcTimestamp', 'CcTimestamp', RelationMap::MANY_TO_ONE, array('timestamp_id' => 'id', ), 'CASCADE', null);
$this->addRelation('CcTimestamp', 'CcTimestamp', RelationMap::MANY_TO_ONE, array('mount_name_id' => 'id', ), 'CASCADE', null);
$this->addRelation('CcMountName', 'CcMountName', RelationMap::MANY_TO_ONE, array('mount_name_id' => 'id', ), 'CASCADE', null);
} // buildRelations()

} // CcListenerCountTableMap
54 changes: 54 additions & 0 deletions airtime_mvc/application/models/airtime/map/CcMountNameTableMap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php



/**
* This class defines the structure of the 'cc_mount_name' table.
*
*
*
* This map class is used by Propel to do runtime db structure discovery.
* For example, the createSelectSql() method checks the type of a given column used in an
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
* (i.e. if it's a text column type).
*
* @package propel.generator.airtime.map
*/
class CcMountNameTableMap extends TableMap {

/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'airtime.map.CcMountNameTableMap';

/**
* Initialize the table attributes, columns and validators
* Relations are not initialized by this method since they are lazy loaded
*
* @return void
* @throws PropelException
*/
public function initialize()
{
// attributes
$this->setName('cc_mount_name');
$this->setPhpName('CcMountName');
$this->setClassname('CcMountName');
$this->setPackage('airtime');
$this->setUseIdGenerator(true);
$this->setPrimaryKeyMethodInfo('cc_mount_name_id_seq');
// columns
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
$this->addColumn('MOUNT_NAME', 'DbMountName', 'VARCHAR', true, 255, null);
// validators
} // initialize()

/**
* Build the RelationMap objects for this table relationships
*/
public function buildRelations()
{
$this->addRelation('CcListenerCount', 'CcListenerCount', RelationMap::ONE_TO_MANY, array('id' => 'mount_name_id', ), 'CASCADE', null);
} // buildRelations()

} // CcMountNameTableMap
58 changes: 29 additions & 29 deletions airtime_mvc/application/models/airtime/om/BaseCcListenerCount.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ abstract class BaseCcListenerCount extends BaseObject implements Persistent
protected $aCcTimestamp;

/**
* @var CcTimestamp
* @var CcMountName
*/
protected $aCcTimestamp;
protected $aCcMountName;

/**
* Flag to prevent endless save loop, if this object is referenced
Expand Down Expand Up @@ -173,8 +173,8 @@ public function setDbMountNameId($v)
$this->modifiedColumns[] = CcListenerCountPeer::MOUNT_NAME_ID;
}

if ($this->aCcTimestamp !== null && $this->aCcTimestamp->getDbId() !== $v) {
$this->aCcTimestamp = null;
if ($this->aCcMountName !== null && $this->aCcMountName->getDbId() !== $v) {
$this->aCcMountName = null;
}

return $this;
Expand Down Expand Up @@ -270,8 +270,8 @@ public function ensureConsistency()
if ($this->aCcTimestamp !== null && $this->timestamp_id !== $this->aCcTimestamp->getDbId()) {
$this->aCcTimestamp = null;
}
if ($this->aCcTimestamp !== null && $this->mount_name_id !== $this->aCcTimestamp->getDbId()) {
$this->aCcTimestamp = null;
if ($this->aCcMountName !== null && $this->mount_name_id !== $this->aCcMountName->getDbId()) {
$this->aCcMountName = null;
}
} // ensureConsistency

Expand Down Expand Up @@ -313,7 +313,7 @@ public function reload($deep = false, PropelPDO $con = null)
if ($deep) { // also de-associate any related objects?
$this->aCcTimestamp = null;
$this->aCcTimestamp = null;
$this->aCcMountName = null;
} // if (deep)
}

Expand Down Expand Up @@ -436,11 +436,11 @@ protected function doSave(PropelPDO $con)
$this->setCcTimestamp($this->aCcTimestamp);
}

if ($this->aCcTimestamp !== null) {
if ($this->aCcTimestamp->isModified() || $this->aCcTimestamp->isNew()) {
$affectedRows += $this->aCcTimestamp->save($con);
if ($this->aCcMountName !== null) {
if ($this->aCcMountName->isModified() || $this->aCcMountName->isNew()) {
$affectedRows += $this->aCcMountName->save($con);
}
$this->setCcTimestamp($this->aCcTimestamp);
$this->setCcMountName($this->aCcMountName);
}

if ($this->isNew() ) {
Expand Down Expand Up @@ -543,9 +543,9 @@ protected function doValidate($columns = null)
}
}

if ($this->aCcTimestamp !== null) {
if (!$this->aCcTimestamp->validate($columns)) {
$failureMap = array_merge($failureMap, $this->aCcTimestamp->getValidationFailures());
if ($this->aCcMountName !== null) {
if (!$this->aCcMountName->validate($columns)) {
$failureMap = array_merge($failureMap, $this->aCcMountName->getValidationFailures());
}
}

Expand Down Expand Up @@ -633,8 +633,8 @@ public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColum
if (null !== $this->aCcTimestamp) {
$result['CcTimestamp'] = $this->aCcTimestamp->toArray($keyType, $includeLazyLoadColumns, true);
}
if (null !== $this->aCcTimestamp) {
$result['CcTimestamp'] = $this->aCcTimestamp->toArray($keyType, $includeLazyLoadColumns, true);
if (null !== $this->aCcMountName) {
$result['CcMountName'] = $this->aCcMountName->toArray($keyType, $includeLazyLoadColumns, true);
}
}
return $result;
Expand Down Expand Up @@ -879,24 +879,24 @@ public function getCcTimestamp(PropelPDO $con = null)
}

/**
* Declares an association between this object and a CcTimestamp object.
* Declares an association between this object and a CcMountName object.
*
* @param CcTimestamp $v
* @param CcMountName $v
* @return CcListenerCount The current object (for fluent API support)
* @throws PropelException
*/
public function setCcTimestamp(CcTimestamp $v = null)
public function setCcMountName(CcMountName $v = null)
{
if ($v === null) {
$this->setDbMountNameId(NULL);
} else {
$this->setDbMountNameId($v->getDbId());
}

$this->aCcTimestamp = $v;
$this->aCcMountName = $v;

// Add binding for other direction of this n:n relationship.
// If this object has already been added to the CcTimestamp object, it will not be re-added.
// If this object has already been added to the CcMountName object, it will not be re-added.
if ($v !== null) {
$v->addCcListenerCount($this);
}
Expand All @@ -906,25 +906,25 @@ public function setCcTimestamp(CcTimestamp $v = null)


/**
* Get the associated CcTimestamp object
* Get the associated CcMountName object
*
* @param PropelPDO Optional Connection object.
* @return CcTimestamp The associated CcTimestamp object.
* @return CcMountName The associated CcMountName object.
* @throws PropelException
*/
public function getCcTimestamp(PropelPDO $con = null)
public function getCcMountName(PropelPDO $con = null)
{
if ($this->aCcTimestamp === null && ($this->mount_name_id !== null)) {
$this->aCcTimestamp = CcTimestampQuery::create()->findPk($this->mount_name_id, $con);
if ($this->aCcMountName === null && ($this->mount_name_id !== null)) {
$this->aCcMountName = CcMountNameQuery::create()->findPk($this->mount_name_id, $con);
/* The following can be used additionally to
guarantee the related object contains a reference
to this object. This level of coupling may, however, be
undesirable since it could result in an only partially populated collection
in the referenced object.
$this->aCcTimestamp->addCcListenerCounts($this);
$this->aCcMountName->addCcListenerCounts($this);
*/
}
return $this->aCcTimestamp;
return $this->aCcMountName;
}

/**
Expand Down Expand Up @@ -959,7 +959,7 @@ public function clearAllReferences($deep = false)
} // if ($deep)

$this->aCcTimestamp = null;
$this->aCcTimestamp = null;
$this->aCcMountName = null;
}

/**
Expand Down
Loading

0 comments on commit 9698898

Please sign in to comment.