本文整理汇总了PHP中Review::isModified方法的典型用法代码示例。如果您正苦于以下问题:PHP Review::isModified方法的具体用法?PHP Review::isModified怎么用?PHP Review::isModified使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Review
的用法示例。
在下文中一共展示了Review::isModified方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testDefaultValues
/**
* Test default return values.
*/
public function testDefaultValues()
{
$r = new Review();
$this->assertEquals('2001-01-01', $r->getReviewDate('Y-m-d'));
$this->assertFalse($r->isModified(), "expected isModified() to be false");
$acct = new BookstoreEmployeeAccount();
$this->assertEquals(true, $acct->getEnabled());
$this->assertFalse($acct->isModified());
$acct->setLogin("testuser");
$acct->setPassword("testpass");
$this->assertTrue($acct->isModified());
}
示例2: testTemporalValues_PreEpoch
/**
* Test the behavior of date/time/values.
* This requires that the model was built with propel.useDateTimeClass=true.
*/
public function testTemporalValues_PreEpoch()
{
$r = new Review();
$preEpochDate = new DateTime('1602-02-02');
$r->setReviewDate($preEpochDate);
$this->assertEquals('1602-02-02', $r->getReviewDate(null)->format("Y-m-d"));
$r->setReviewDate('1702-02-02');
$this->assertTrue($r->isModified());
$this->assertEquals('1702-02-02', $r->getReviewDate(null)->format("Y-m-d"));
// Now test for setting null
$r->setReviewDate(null);
$this->assertNull($r->getReviewDate());
}
示例3: doSave
/**
* Performs the work of inserting or updating the row in the database.
*
* If the object is new, it inserts it; otherwise an update is performed.
* All related objects are also updated in this method.
*
* @param PropelPDO $con
* @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
* @throws PropelException
* @see save()
*/
protected function doSave(PropelPDO $con)
{
$affectedRows = 0;
// initialize var to track total num of affected rows
if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
// We call the save method on the following object(s) if they
// were passed to this object by their coresponding set
// method. This object relates to these object(s) by a
// foreign key reference.
if ($this->aSeries !== null) {
if ($this->aSeries->isModified() || $this->aSeries->isNew()) {
$affectedRows += $this->aSeries->save($con);
}
$this->setSeries($this->aSeries);
}
if ($this->aReview !== null) {
if ($this->aReview->isModified() || $this->aReview->isNew()) {
$affectedRows += $this->aReview->save($con);
}
$this->setReview($this->aReview);
}
if ($this->aScore !== null) {
if ($this->aScore->isModified() || $this->aScore->isNew()) {
$affectedRows += $this->aScore->save($con);
}
$this->setScore($this->aScore);
}
if ($this->isNew()) {
$this->modifiedColumns[] = ModelPeer::ID;
}
// If this object has been modified, then save it to the database.
if ($this->isModified()) {
if ($this->isNew()) {
$pk = ModelPeer::doInsert($this, $con);
$affectedRows += 1;
// we are assuming that there is only 1 row per doInsert() which
// should always be true here (even though technically
// BasePeer::doInsert() can insert multiple rows).
$this->setId($pk);
//[IMV] update autoincrement primary key
$this->setNew(false);
} else {
$affectedRows += ModelPeer::doUpdate($this, $con);
}
$this->resetModified();
// [HL] After being saved an object is no longer 'modified'
}
if ($this->collConfigs !== null) {
foreach ($this->collConfigs as $referrerFK) {
if (!$referrerFK->isDeleted()) {
$affectedRows += $referrerFK->save($con);
}
}
}
if ($this->collReviews !== null) {
foreach ($this->collReviews as $referrerFK) {
if (!$referrerFK->isDeleted()) {
$affectedRows += $referrerFK->save($con);
}
}
}
if ($this->collScores !== null) {
foreach ($this->collScores as $referrerFK) {
if (!$referrerFK->isDeleted()) {
$affectedRows += $referrerFK->save($con);
}
}
}
if ($this->collUserMetas !== null) {
foreach ($this->collUserMetas as $referrerFK) {
if (!$referrerFK->isDeleted()) {
$affectedRows += $referrerFK->save($con);
}
}
}
$this->alreadyInSave = false;
}
return $affectedRows;
}