propelorm/Propel2

View on GitHub
templates/Behavior/Archivable/objectSaveWithoutArchive.php

Summary

Maintainability
A
0 mins
Test Coverage

/**
 * Persists the object to the database without archiving it.
 *
 * @param ConnectionInterface|null $con Optional connection object
 *
 * @return $this|<?php echo $objectClassName ?> The current object (for fluent API support)
 */
public function saveWithoutArchive(?ConnectionInterface $con = null)
{
<?php if (!$isArchiveOnInsert): ?>
    if (!$this->isNew()) {
        $this->archiveOnUpdate = false;
    }
<?php elseif (!$isArchiveOnUpdate): ?>
    if ($this->isNew()) {
        $this->archiveOnInsert = false;
    }
<?php else: ?>
    if ($this->isNew()) {
        $this->archiveOnInsert = false;
    } else {
        $this->archiveOnUpdate = false;
    }
<?php endif; ?>

    return $this->save($con);
}