Skip to content

Commit

Permalink
updated propel models for varchar barcode
Browse files Browse the repository at this point in the history
  • Loading branch information
briankelleher committed Dec 7, 2016
1 parent ca0ff2e commit c9d378a
Show file tree
Hide file tree
Showing 11 changed files with 162 additions and 155 deletions.
108 changes: 54 additions & 54 deletions api/generated-classes/Base/CategoryRankNutrient.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ abstract class CategoryRankNutrient implements ActiveRecordInterface
protected $nutrient_id;

/**
* @var ChildNutrient
* @var ChildCategory
*/
protected $aNutrient;
protected $aCategory;

/**
* @var ChildCategory
* @var ChildNutrient
*/
protected $aCategory;
protected $aNutrient;

/**
* @var ChildRank
Expand Down Expand Up @@ -718,8 +718,8 @@ public function reload($deep = false, ConnectionInterface $con = null)

if ($deep) { // also de-associate any related objects?
$this->aNutrient = null;
$this->aCategory = null;
$this->aNutrient = null;
$this->aRank = null;
} // if (deep)
}
Expand Down Expand Up @@ -825,20 +825,20 @@ protected function doSave(ConnectionInterface $con)
// method. This object relates to these object(s) by a
// foreign key reference.

if ($this->aNutrient !== null) {
if ($this->aNutrient->isModified() || $this->aNutrient->isNew()) {
$affectedRows += $this->aNutrient->save($con);
}
$this->setNutrient($this->aNutrient);
}

if ($this->aCategory !== null) {
if ($this->aCategory->isModified() || $this->aCategory->isNew()) {
$affectedRows += $this->aCategory->save($con);
}
$this->setCategory($this->aCategory);
}

if ($this->aNutrient !== null) {
if ($this->aNutrient->isModified() || $this->aNutrient->isNew()) {
$affectedRows += $this->aNutrient->save($con);
}
$this->setNutrient($this->aNutrient);
}

if ($this->aRank !== null) {
if ($this->aRank->isModified() || $this->aRank->isNew()) {
$affectedRows += $this->aRank->save($con);
Expand Down Expand Up @@ -1063,35 +1063,35 @@ public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColum
}

if ($includeForeignObjects) {
if (null !== $this->aNutrient) {
if (null !== $this->aCategory) {

switch ($keyType) {
case TableMap::TYPE_CAMELNAME:
$key = 'nutrient';
$key = 'category';
break;
case TableMap::TYPE_FIELDNAME:
$key = 'Nutrient';
$key = 'Category';
break;
default:
$key = 'Nutrient';
$key = 'Category';
}

$result[$key] = $this->aNutrient->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
$result[$key] = $this->aCategory->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
if (null !== $this->aCategory) {
if (null !== $this->aNutrient) {

switch ($keyType) {
case TableMap::TYPE_CAMELNAME:
$key = 'category';
$key = 'nutrient';
break;
case TableMap::TYPE_FIELDNAME:
$key = 'Category';
$key = 'Nutrient';
break;
default:
$key = 'Category';
$key = 'Nutrient';
}

$result[$key] = $this->aCategory->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
$result[$key] = $this->aNutrient->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
if (null !== $this->aRank) {

Expand Down Expand Up @@ -1393,24 +1393,24 @@ public function copy($deepCopy = false)
}

/**
* Declares an association between this object and a ChildNutrient object.
* Declares an association between this object and a ChildCategory object.
*
* @param ChildNutrient $v
* @param ChildCategory $v
* @return $this|\CategoryRankNutrient The current object (for fluent API support)
* @throws PropelException
*/
public function setNutrient(ChildNutrient $v = null)
public function setCategory(ChildCategory $v = null)
{
if ($v === null) {
$this->setNutrientId(NULL);
$this->setCategoryId(NULL);
} else {
$this->setNutrientId($v->getId());
$this->setCategoryId($v->getId());
}

$this->aNutrient = $v;
$this->aCategory = $v;

// Add binding for other direction of this n:n relationship.
// If this object has already been added to the ChildNutrient object, it will not be re-added.
// If this object has already been added to the ChildCategory object, it will not be re-added.
if ($v !== null) {
$v->addCategoryRankNutrient($this);
}
Expand All @@ -1421,47 +1421,47 @@ public function setNutrient(ChildNutrient $v = null)


/**
* Get the associated ChildNutrient object
* Get the associated ChildCategory object
*
* @param ConnectionInterface $con Optional Connection object.
* @return ChildNutrient The associated ChildNutrient object.
* @return ChildCategory The associated ChildCategory object.
* @throws PropelException
*/
public function getNutrient(ConnectionInterface $con = null)
public function getCategory(ConnectionInterface $con = null)
{
if ($this->aNutrient === null && ($this->nutrient_id !== null)) {
$this->aNutrient = ChildNutrientQuery::create()->findPk($this->nutrient_id, $con);
if ($this->aCategory === null && ($this->category_id !== null)) {
$this->aCategory = ChildCategoryQuery::create()->findPk($this->category_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->aNutrient->addCategoryRankNutrients($this);
$this->aCategory->addCategoryRankNutrients($this);
*/
}

return $this->aNutrient;
return $this->aCategory;
}

/**
* Declares an association between this object and a ChildCategory object.
* Declares an association between this object and a ChildNutrient object.
*
* @param ChildCategory $v
* @param ChildNutrient $v
* @return $this|\CategoryRankNutrient The current object (for fluent API support)
* @throws PropelException
*/
public function setCategory(ChildCategory $v = null)
public function setNutrient(ChildNutrient $v = null)
{
if ($v === null) {
$this->setCategoryId(NULL);
$this->setNutrientId(NULL);
} else {
$this->setCategoryId($v->getId());
$this->setNutrientId($v->getId());
}

$this->aCategory = $v;
$this->aNutrient = $v;

// Add binding for other direction of this n:n relationship.
// If this object has already been added to the ChildCategory object, it will not be re-added.
// If this object has already been added to the ChildNutrient object, it will not be re-added.
if ($v !== null) {
$v->addCategoryRankNutrient($this);
}
Expand All @@ -1472,26 +1472,26 @@ public function setCategory(ChildCategory $v = null)


/**
* Get the associated ChildCategory object
* Get the associated ChildNutrient object
*
* @param ConnectionInterface $con Optional Connection object.
* @return ChildCategory The associated ChildCategory object.
* @return ChildNutrient The associated ChildNutrient object.
* @throws PropelException
*/
public function getCategory(ConnectionInterface $con = null)
public function getNutrient(ConnectionInterface $con = null)
{
if ($this->aCategory === null && ($this->category_id !== null)) {
$this->aCategory = ChildCategoryQuery::create()->findPk($this->category_id, $con);
if ($this->aNutrient === null && ($this->nutrient_id !== null)) {
$this->aNutrient = ChildNutrientQuery::create()->findPk($this->nutrient_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->aCategory->addCategoryRankNutrients($this);
$this->aNutrient->addCategoryRankNutrients($this);
*/
}

return $this->aCategory;
return $this->aNutrient;
}

/**
Expand Down Expand Up @@ -1552,12 +1552,12 @@ public function getRank(ConnectionInterface $con = null)
*/
public function clear()
{
if (null !== $this->aNutrient) {
$this->aNutrient->removeCategoryRankNutrient($this);
}
if (null !== $this->aCategory) {
$this->aCategory->removeCategoryRankNutrient($this);
}
if (null !== $this->aNutrient) {
$this->aNutrient->removeCategoryRankNutrient($this);
}
if (null !== $this->aRank) {
$this->aRank->removeCategoryRankNutrient($this);
}
Expand Down Expand Up @@ -1588,8 +1588,8 @@ public function clearAllReferences($deep = false)
if ($deep) {
} // if ($deep)

$this->aNutrient = null;
$this->aCategory = null;
$this->aNutrient = null;
$this->aRank = null;
}

Expand Down
Loading

0 comments on commit c9d378a

Please sign in to comment.