i have the following code:
$res = RcProfileRelationTablePeer::hasRelation($requestor_profile->getId(), $requestee_profile->getId());
if(!$res)
{
try
{
$new_relation = new RcProfileRelationTable();
$new_relation->setProfileId($requestor_profile->getId());
$new_relation->setProfileIdContact($requestee_profile->getId());
$new_relation->save();
echo "after save".$requestor_profile->getId()." ".$requestee_profile->getId();
return true;
}catch(PropelException $e)
{
echo "in die";
die($e);
return false;
}
}//end - if (!$res)
the echo after the save executes but when i look in my db table there is nothing????
please help???
public function save(PropelPDO $con = null)
{
if ($this->isDeleted()) {
throw new PropelException("You cannot save an object that has been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(RcProfileRelationTablePeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
$con->beginTransaction();
$isInsert = $this->isNew();
try {
$ret = $this->preSave($con);
// symfony_behaviors behavior
foreach (sfMixer::getCallables('BaseRcProfileRelationTable:save:pre') as $callable)
{
if (is_integer($affectedRows = call_user_func($callable, $this, $con)))
{
return $affectedRows;
}
}
// symfony_timestampable behavior
if ($isInsert) {
$ret = $ret && $this->preInsert($con);
// symfony_timestampable behavior
if (!$this->isColumnModified(RcProfileRelationTablePeer::CREATED_AT))
{
$this->setCreatedAt(time());
}
} else {
$ret = $ret && $this->preUpdate($con);
}
if ($ret) {
$affectedRows = $this->doSave($con);
if ($isInsert) {
$this->postInsert($con);
} else {
$this->postUpdate($con);
}
$this->postSave($con);
// symfony_behaviors behavior
foreach (sfMixer::getCallables('BaseRcProfileRelationTable:save:post') as $callable)
{
call_user_func($callable, $this, $con, $affectedRows);
}
RcProfileRelationTablePeer::addInstanceToPool($this);
} else {
$affectedRows = 0;
}
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}