/** * oxActions::delete() test case * Deleting existing action, everything must go fine * * @return null */ public function testDelete() { $sArtOxid = 'xxx'; $this->_oAction->addArticle($sArtOxid); $this->_oAction->delete(); $sCheckOxid = oxDb::getDb(oxDB::FETCH_MODE_ASSOC)->GetOne("select oxid from oxactions2article where oxactionid = '" . $this->_oAction->getId() . "'"); $oAction = oxNew("oxActions"); if ($sCheckOxid || $oAction->Load($this->sOxId)) { $this->fail("fail deleting"); } }
/** * Sets contents of passed object to values from current object. * * If desired, this method can also make copies of all associated (fkey referrers) * objects. * * @param object $copyObj An object of Book (or compatible) type. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. * @throws PropelException */ public function copyInto($copyObj, $deepCopy = false) { $copyObj->setName($this->name); if ($deepCopy) { // important: temporarily setNew(false) because this affects the behavior of // the getter/setter methods for fkey referrer objects. $copyObj->setNew(false); foreach ($this->getArticles() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addArticle($relObj->copy($deepCopy)); } } } // if ($deepCopy) $copyObj->setNew(true); $copyObj->setId(NULL); // this is a auto-increment column, so set to default value }
/** * Sets contents of passed object to values from current object. * * If desired, this method can also make copies of all associated (fkey referrers) * objects. * * @param object $copyObj An object of \Models\User (or compatible) type. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. * @param boolean $makeNew Whether to reset autoincrement PKs and make the object new. * @throws PropelException */ public function copyInto($copyObj, $deepCopy = false, $makeNew = true) { $copyObj->setIdMember($this->getIdMember()); $copyObj->setUsername($this->getUsername()); $copyObj->setMemberFrom($this->getMemberFrom()); $copyObj->setUrl($this->getUrl()); $copyObj->setEmail($this->getEmail()); $copyObj->setEmailConfirmedAt($this->getEmailConfirmedAt()); $copyObj->setEmailConfirmToken($this->getEmailConfirmToken()); $copyObj->setEmailChangeToken($this->getEmailChangeToken()); $copyObj->setPassword($this->getPassword()); $copyObj->setPasswordResetToken($this->getPasswordResetToken()); $copyObj->setPermissions($this->getPermissions()); $copyObj->setSigninCount($this->getSigninCount()); $copyObj->setIdImage($this->getIdImage()); $copyObj->setLastSigninAt($this->getLastSigninAt()); $copyObj->setCreatedAt($this->getCreatedAt()); $copyObj->setUpdatedAt($this->getUpdatedAt()); if ($deepCopy) { // important: temporarily setNew(false) because this affects the behavior of // the getter/setter methods for fkey referrer objects. $copyObj->setNew(false); foreach ($this->getArticles() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addArticle($relObj->copy($deepCopy)); } } foreach ($this->getComments() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addComment($relObj->copy($deepCopy)); } } foreach ($this->getRatings() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addRating($relObj->copy($deepCopy)); } } foreach ($this->getUserReportsRelatedByIdUser() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addUserReportRelatedByIdUser($relObj->copy($deepCopy)); } } foreach ($this->getUserReportsRelatedByIdUserReported() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addUserReportRelatedByIdUserReported($relObj->copy($deepCopy)); } } foreach ($this->getBugReports() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addBugReport($relObj->copy($deepCopy)); } } foreach ($this->getIdeasRelatedByIdUser() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addIdeaRelatedByIdUser($relObj->copy($deepCopy)); } } foreach ($this->getIdeasRelatedByApprovedBy() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addIdeaRelatedByApprovedBy($relObj->copy($deepCopy)); } } foreach ($this->getMembershipApplications() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addMembershipApplication($relObj->copy($deepCopy)); } } foreach ($this->getGalleries() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addGallery($relObj->copy($deepCopy)); } } foreach ($this->getBansRelatedByIdUser() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addBanRelatedByIdUser($relObj->copy($deepCopy)); } } foreach ($this->getBansRelatedByBannedBy() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addBanRelatedByBannedBy($relObj->copy($deepCopy)); } } } // if ($deepCopy) if ($makeNew) { $copyObj->setNew(true); $copyObj->setId(NULL); // this is a auto-increment column, so set to default value } }
/** * Sets contents of passed object to values from current object. * * If desired, this method can also make copies of all associated (fkey referrers) * objects. * * @param object $copyObj An object of \Models\Image (or compatible) type. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. * @param boolean $makeNew Whether to reset autoincrement PKs and make the object new. * @throws PropelException */ public function copyInto($copyObj, $deepCopy = false, $makeNew = true) { $copyObj->setTitle($this->getTitle()); $copyObj->setDescription($this->getDescription()); $copyObj->setPath($this->getPath()); $copyObj->setThumbnailPath($this->getThumbnailPath()); $copyObj->setType($this->getType()); $copyObj->setCreatedAt($this->getCreatedAt()); $copyObj->setUpdatedAt($this->getUpdatedAt()); if ($deepCopy) { // important: temporarily setNew(false) because this affects the behavior of // the getter/setter methods for fkey referrer objects. $copyObj->setNew(false); foreach ($this->getUsers() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addUser($relObj->copy($deepCopy)); } } foreach ($this->getArticles() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addArticle($relObj->copy($deepCopy)); } } foreach ($this->getImageGalleryMaps() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addImageGalleryMap($relObj->copy($deepCopy)); } } } // if ($deepCopy) if ($makeNew) { $copyObj->setNew(true); $copyObj->setId(NULL); // this is a auto-increment column, so set to default value } }