本文整理汇总了PHP中Log::setMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP Log::setMessage方法的具体用法?PHP Log::setMessage怎么用?PHP Log::setMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Log
的用法示例。
在下文中一共展示了Log::setMessage方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
/**
* Serialize the form into the database.
*
*/
public function save($con = null)
{
if ($this->getObject()) {
$j = $this->getObject();
} else {
$j = new Job();
}
$j->setPublicationId($this->getValue("publication_id"));
$j->setStatusId($this->getValue("status_id"));
$j->setEvent($this->getValue("event"));
$j->setDate($this->getValue("date"));
$j->setStartTime($this->getValue("start_time"));
$j->setEndTime($this->getValue("end_time"));
$j->setDueDate($this->getValue("due_date"));
$j->setContactName($this->getValue("contact_name"));
$j->setContactPhone($this->getValue("contact_phone"));
$j->setContactEmail($this->getValue("contact_email"));
$j->setAcctNum($this->getValue("acct_num"));
$j->save();
$logEntry = new Log();
$logEntry->setWhen(time());
$logEntry->setPropelClass("Job");
$logEntry->setSfGuardUserProfileId(sfContext::getInstance()->getUser()->getUserId());
$logEntry->setMessage("Basic info updated.");
$logEntry->setLogMessageTypeId(sfConfig::get("app_log_type_update"));
$logEntry->setPropelId($j->getId());
$logEntry->save();
}
示例2: save
public function save(PropelPDO $con = null)
{
$logEntry = new Log();
$logEntry->setWhen(time());
$logEntry->setPropelClass("Delivery");
$logEntry->setSfGuardUserProfileId(sfContext::getInstance()->getUser()->getUserId());
// this is a new job
if ($this->isNew()) {
$logEntry->setMessage("Delivery created.");
$logEntry->setLogMessageTypeId(sfConfig::get("app_log_type_create"));
} else {
$logEntry->setMessage("Delivery updated.");
$logEntry->setLogMessageTypeId(sfConfig::get("app_log_type_update"));
}
parent::save($con);
$logEntry->setPropelId($this->getId());
$logEntry->save();
}
示例3: addEmailLogMessage
public static function addEmailLogMessage($jobId, $emailType, $toUser)
{
$logEntry = new Log();
$logEntry->setWhen(time());
$logEntry->setPropelClass("Job");
$logEntry->setSfGuardUserProfileId(sfContext::getInstance()->getUser()->getUserId());
$logEntry->setMessage($emailType . " sent to user " . $toUser);
$logEntry->setLogMessageTypeId(sfConfig::get("app_log_type_email"));
$logEntry->setPropelId($jobId);
$logEntry->save();
}
示例4: delete
public function delete(PropelPDO $con = null)
{
$logEntry = new Log();
$logEntry->setWhen(time());
$logEntry->setPropelClass("Project");
$logEntry->setSfGuardUserProfileId(sfContext::getInstance()->getUser()->getUserId());
$logEntry->setMessage("Project deleted.");
$logEntry->setLogMessageTypeId(sfConfig::get("app_log_type_delete"));
$logEntry->setPropelId($this->getId());
$logEntry->save();
parent::delete($con);
}
示例5: save
/**
* Serialize the form into the database.
*
*/
public function save($con = null)
{
if ($this->getObject()) {
$j = $this->getObject();
} else {
$j = new Job();
}
$j->setEstimate($this->getValue("estimate"));
$j->setProcessing($this->getValue("processing"));
$j->save();
$logEntry = new Log();
$logEntry->setWhen(time());
$logEntry->setPropelClass("Job");
$logEntry->setSfGuardUserProfileId(sfContext::getInstance()->getUser()->getUserId());
$logEntry->setMessage("Billing info updated.");
$logEntry->setLogMessageTypeId(sfConfig::get("app_log_type_update"));
$logEntry->setPropelId($j->getId());
$logEntry->save();
}
示例6: save
/**
* Serialize the form into the database.
*
*/
public function save($con = null)
{
if ($this->getObject()) {
$j = $this->getObject();
} else {
$j = new Job();
}
$j->setState($this->getValue("state"));
$j->setCity($this->getValue("city"));
$j->setZip($this->getValue("zip"));
$j->setStreet($this->getValue("street"));
$j->save();
$logEntry = new Log();
$logEntry->setWhen(time());
$logEntry->setPropelClass("Job");
$logEntry->setSfGuardUserProfileId(sfContext::getInstance()->getUser()->getUserId());
$logEntry->setMessage("Shoot info updated.");
$logEntry->setLogMessageTypeId(sfConfig::get("app_log_type_update"));
$logEntry->setPropelId($j->getId());
$logEntry->save();
}
示例7: save
/**
* Serialize the form into the database.
*
*/
public function save($con = null)
{
if ($this->getObject()) {
$j = $this->getObject();
} else {
$j = new Job();
}
$j->setPhotoType(implode(", ", $this->getValue("photo_type")));
$j->setQues1($this->getValue("ques1"));
$j->setQues2($this->getValue("ques2"));
$j->setQues3($this->getValue("ques3"));
$j->setOther($this->getValue("other"));
$j->save();
$logEntry = new Log();
$logEntry->setWhen(time());
$logEntry->setPropelClass("Job");
$logEntry->setSfGuardUserProfileId(sfContext::getInstance()->getUser()->getUserId());
$logEntry->setMessage("Photography info updated.");
$logEntry->setLogMessageTypeId(sfConfig::get("app_log_type_update"));
$logEntry->setPropelId($j->getId());
$logEntry->save();
}
示例8: testUpDelete
public function testUpDelete()
{
$this->objLog->setLog('Test', 'testUpdadeDelete', false);
$criteria = new Criteria();
$criteria->add(LogPeer::MESSAGE, 'testUpdadeDelete');
$log = new Log();
/* @var $obj Log */
$obj = $log->doSelectOne($criteria);
$test = $obj instanceof Log;
$this->assertTrue($test);
$test = $obj->getId();
$log = new Log();
$log->setId($test);
$log->setMessage('removeTest');
$log->save();
$criteria = new Criteria();
$criteria->add(LogPeer::MESSAGE, 'removeTest');
$log = new Log();
/* @var $obj Log */
$obj = $log->doSelectOne($criteria);
$this->assertEquals('removeTest', $obj->getMessage());
$obj->delete();
}
示例9: ConvertingObject
/**
* Converts the object to the object class
* @param stdClass $stdClass
* @return object
*/
private function ConvertingObject(stdClass $stdClass)
{
$ObjLogPeer = new Log();
$ObjLogPeer->setId($stdClass->id);
$ObjLogPeer->setDate($stdClass->date);
$ObjLogPeer->setFile($stdClass->file);
$ObjLogPeer->setMessage($stdClass->message);
$ObjLogPeer->setIsError($stdClass->is_error);
return $ObjLogPeer;
}
示例10: save
public function save(PropelPDO $con = null)
{
$isNew = $this->isNew();
// see if we need to do revision control on the notes
$updateNotes = in_array(JobPeer::NOTES, $this->modifiedColumns) && strlen($this->getNotes() > 1);
if (is_null($con)) {
$con = Propel::getConnection(JobPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
$con->beginTransaction();
try {
$ret = parent::save($con);
$con->commit();
} catch (Exception $e) {
$con->rollBack();
throw $e;
}
$arr = $this->createCalendarArray();
if (!is_null(sfContext::getInstance()->getUser())) {
$uid = sfContext::getInstance()->getUser()->getUserId();
} else {
$uid = 1;
}
if ($isNew) {
$logEntry = new Log();
$logEntry->setWhen(time());
$logEntry->setPropelClass("Job");
$logEntry->setSfGuardUserProfileId($uid);
$logEntry->setMessage("Job created.");
$logEntry->setLogMessageTypeId(sfConfig::get("app_log_type_create"));
$logEntry->setPropelId($this->getId());
$logEntry->save();
if ($this->getDate("U") > 0) {
$event = sfGCalendar::createJobEvent($arr);
$this->setGCalId($event->id);
parent::save($con);
}
} else {
if ($this->getDate("U") > 0) {
if (is_null($this->getGCalId())) {
$event = sfGCalendar::createJobEvent($arr);
$this->setGCalId($event->id);
parent::save($con);
} else {
sfGCalendar::updateJobEventById($this->getGCalId(), $arr);
}
if (!is_null($this->getGCalIdCustomUrl())) {
if (!is_null($this->getGCalIdCustom())) {
$arr["calUrl"] = $this->getGCalIdCustomUrl();
sfGCalendar::updateJobEventById($this->getGCalIdCustom(), $arr);
} else {
$arr["calUrl"] = $url;
$event = sfGCalendar::createJobEvent($arr);
$this->setGCalIdCustom($event->id);
}
}
}
}
if ($updateNotes) {
$c = new Criteria();
$c->add(JobNotesPeer::JOB_ID, $this->getId());
$c->addDescendingOrderByColumn(JobNotesPeer::ID);
$old = JobNotesPeer::doSelectOne($c);
$rev = !is_null($old) ? $old->getRevision() + 1 : 1;
$jn = new JobNotes();
$jn->setJobId($this->getId());
$jn->setNotes($this->getNotes());
$jn->setRevision($rev);
$jn->setUserId(sfContext::getInstance()->getUser()->getUserId());
$jn->save();
}
}