/** * 增加评论 * * @param array $data 所要增加的评论数据 * @return false|insertid */ public function addComment($data) { $validate = new CommentValidate(); if (!$validate->add($data)) { return $this->setErrorMsg($validate->getErrorMessage()); } if (!empty($data['replyid'])) { $replyInfo = $this->commentModel->getCommentById($data['replyid']); if (empty($replyInfo)) { return $this->setErrorMsg(Lang::get('comment.reply_comment_not_exist')); } $data['reply_ids'] = !empty($replyInfo['reply_ids']) ? $data['replyid'] . ',' . $replyInfo['reply_ids'] : $data['replyid']; unset($data['replyid']); } $data['time'] = time(); $result = $this->commentModel->addComment($data); if ($result === false) { return $this->setErrorMsg(Lang::get('comment.action_error')); } return $result->id; }
/** * 回复评论 */ private function commentReply() { $data['object_id'] = (int) Request::input('objectid'); $data['object_type'] = (int) Request::input('object_type'); $data['nickname'] = strip_tags(Request::input('nickname')); $data['content'] = strip_tags(Request::input('comment')); $data['replyid'] = (int) Request::input('replyid'); $insertId = $this->commentProcess->addComment($data); if ($insertId !== false) { $this->setActionLog(['replyid' => $data['replyid'], 'object_id' => $data['object_id'], 'content' => $data['content']]); return Js::execute('window.parent.loadComment(' . $insertId . ');'); } return Js::error($this->commentProcess->getErrorMessage()) . Js::execute('window.parent.reloadDialogTitle();'); }
/** * 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\Note (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->setUserId($this->getUserId()); $copyObj->setImportance($this->getImportance()); $copyObj->setTitle($this->getTitle()); $copyObj->setDeadline($this->getDeadline()); $copyObj->setCategoryId($this->getCategoryId()); $copyObj->setState($this->getState()); $copyObj->setRepeatAfter($this->getRepeatAfter()); $copyObj->setDoneAt($this->getDoneAt()); $copyObj->setPublic($this->getPublic()); $copyObj->setDescription($this->getDescription()); $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->getSubNotes() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addSubNote($relObj->copy($deepCopy)); } } foreach ($this->getFiles() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addFile($relObj->copy($deepCopy)); } } foreach ($this->getNotifications() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addNotification($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->getShareds() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addShared($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\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 Article (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->setTitle($this->title); $copyObj->setContent($this->content); $copyObj->setCreatedAt($this->created_at); $copyObj->setTag($this->tag); 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->getComments() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addComment($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->setUsername($this->getUsername()); $copyObj->setName($this->getName()); $copyObj->setSurname($this->getSurname()); $copyObj->setPassword($this->getPassword()); $copyObj->setEmail($this->getEmail()); $copyObj->setAvatarPath($this->getAvatarPath()); $copyObj->setPasswordResetToken($this->getPasswordResetToken()); $copyObj->setEmailConfirmToken($this->getEmailConfirmToken()); $copyObj->setEmailConfirmedAt($this->getEmailConfirmedAt()); $copyObj->setDeletedAt($this->getDeletedAt()); $copyObj->setAccountRestoreToken($this->getAccountRestoreToken()); $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->getIdentities() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addIdentity($relObj->copy($deepCopy)); } } foreach ($this->getPackPermissions() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addPackPermission($relObj->copy($deepCopy)); } } foreach ($this->getPacks() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addPack($relObj->copy($deepCopy)); } } foreach ($this->getMyGroups() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addMyGroup($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->getUserGroups() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addUserGroup($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 Branch (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->setRepositoryId($this->getRepositoryId()); $copyObj->setName($this->getName()); $copyObj->setBaseBranchName($this->getBaseBranchName()); $copyObj->setCommitReference($this->getCommitReference()); $copyObj->setLastCommit($this->getLastCommit()); $copyObj->setLastCommitDesc($this->getLastCommitDesc()); $copyObj->setIsBlacklisted($this->getIsBlacklisted()); $copyObj->setReviewRequest($this->getReviewRequest()); $copyObj->setStatus($this->getStatus()); $copyObj->setCommitStatusChanged($this->getCommitStatusChanged()); $copyObj->setUserStatusChanged($this->getUserStatusChanged()); $copyObj->setDateStatusChanged($this->getDateStatusChanged()); $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->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->getFiles() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addFile($relObj->copy($deepCopy)); } } foreach ($this->getStatusActions() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addStatusAction($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 \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->setRcsId($this->getRcsId()); $copyObj->setFirstName($this->getFirstName()); $copyObj->setLastName($this->getLastName()); $copyObj->setEmail($this->getEmail()); $copyObj->setPermissionLevel($this->getPermissionLevel()); 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->getEvents() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addEvent($relObj->copy($deepCopy)); } } foreach ($this->getInterests() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addInterest($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)); } } } // if ($deepCopy) if ($makeNew) { $copyObj->setNew(true); $copyObj->setUserId(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 \Event (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->setDate($this->getDate()); $copyObj->setStartTime($this->getStartTime()); $copyObj->setEndTime($this->getEndTime()); $copyObj->setLocation($this->getLocation()); $copyObj->setDescription($this->getDescription()); $copyObj->setMaxAttendance($this->getMaxAttendance()); $copyObj->setCreatorUserId($this->getCreatorUserId()); 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->getInterests() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addInterest($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)); } } } // if ($deepCopy) if ($makeNew) { $copyObj->setNew(true); $copyObj->setEventId(NULL); // this is a auto-increment column, so set to default value } }
/** * Adds comment to given Payment object. * * @param object $oPayment * @param string $sComment */ protected function _addComment($oPayment, $sComment) { if ($sComment) { $oComment = oxNew('oePayPalOrderPaymentComment'); $oComment->setComment($sComment); $oPayment->addComment($oComment); } }
/** * 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\Pack (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->setName($this->getName()); $copyObj->setDescription($this->getDescription()); $copyObj->setPrivate($this->getPrivate()); $copyObj->setOwnerId($this->getOwnerId()); $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->getPackPermissions() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addPackPermission($relObj->copy($deepCopy)); } } foreach ($this->getFiles() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addFile($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)); } } } // 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\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->setNick($this->getNick()); $copyObj->setEmail($this->getEmail()); $copyObj->setRights($this->getRights()); $copyObj->setEmailConfirmedAt($this->getEmailConfirmedAt()); $copyObj->setPassword($this->getPassword()); $copyObj->setPasswordResetToken($this->getPasswordResetToken()); $copyObj->setSigninCount($this->getSigninCount()); $copyObj->setEmailConfirmToken($this->getEmailConfirmToken()); $copyObj->setAvatarPath($this->getAvatarPath()); $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->getNotes() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addNote($relObj->copy($deepCopy)); } } foreach ($this->getCategories() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addCategory($relObj->copy($deepCopy)); } } foreach ($this->getNotificationsRelatedByUserId() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addNotificationRelatedByUserId($relObj->copy($deepCopy)); } } foreach ($this->getNotificationsRelatedByOriginTypeOriginId() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addNotificationRelatedByOriginTypeOriginId($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->getIdentities() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addIdentity($relObj->copy($deepCopy)); } } foreach ($this->getUserGroups() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addUserGroup($relObj->copy($deepCopy)); } } foreach ($this->getShareds() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addShared($relObj->copy($deepCopy)); } } } // if ($deepCopy) if ($makeNew) { $copyObj->setNew(true); $copyObj->setId(NULL); // this is a auto-increment column, so set to default value } }