本文整理汇总了PHP中Pimcore\Logger::notice方法的典型用法代码示例。如果您正苦于以下问题:PHP Logger::notice方法的具体用法?PHP Logger::notice怎么用?PHP Logger::notice使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pimcore\Logger
的用法示例。
在下文中一共展示了Logger::notice方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: paymentAction
public function paymentAction()
{
$gateway = $this->getModule()->getGateway();
if (!$gateway->supportsPurchase()) {
\Pimcore\Logger::error("OmniPay Gateway payment [" . $this->getModule()->getName() . "] does not support purchase");
throw new \CoreShop\Exception("Gateway doesn't support purchase!");
}
$params = $this->getGatewayParams();
$response = $gateway->purchase($params)->send();
if ($response instanceof \Omnipay\Common\Message\ResponseInterface) {
if ($response->getTransactionReference()) {
$this->cart->setCustomIdentifier($response->getTransactionReference());
} else {
$this->cart->setCustomIdentifier($params['transactionId']);
}
$this->cart->save();
try {
if ($response->isSuccessful()) {
\Pimcore\Logger::notice("OmniPay Gateway payment [" . $this->getModule()->getName() . "]: Gateway successfully responded redirect!");
$this->redirect($params['returnUrl']);
} else {
if ($response->isRedirect()) {
if ($response instanceof \Omnipay\Common\Message\RedirectResponseInterface) {
\Pimcore\Logger::notice("OmniPay Gateway payment [" . $this->getModule()->getName() . "]: response is a redirect. RedirectMethod: " . $response->getRedirectMethod());
if ($response->getRedirectMethod() === "GET") {
$this->redirect($response->getRedirectUrl());
} else {
$this->view->response = $response;
$this->_helper->viewRenderer('payment/post', null, true);
}
}
} else {
throw new \CoreShop\Exception($response->getMessage());
}
}
} catch (\Exception $e) {
\Pimcore\Logger::error("OmniPay Gateway payment [" . $this->getModule()->getName() . "] Error: " . $e->getMessage());
}
}
}
示例2: checkValidity
/**
* @return bool
*/
public function checkValidity()
{
$sane = true;
if ($this->type == "asset" && !empty($this->id)) {
$el = Asset::getById($this->id);
if (!$el instanceof Asset) {
$sane = false;
Logger::notice("Detected insane relation, removing reference to non existent asset with id [" . $this->id . "]");
$this->id = null;
$this->type = null;
}
}
if (!($poster = Asset::getById($this->poster))) {
$sane = false;
Logger::notice("Detected insane relation, removing reference to non existent asset with id [" . $this->id . "]");
$this->poster = null;
}
return $sane;
}
示例3: checkValidity
/**
* @return bool
*/
public function checkValidity()
{
$sane = true;
if ($this->id) {
$el = Element\Service::getElementById($this->type, $this->id);
if (!$el instanceof Element\ElementInterface) {
$sane = false;
Logger::notice("Detected insane relation, removing reference to non existent " . $this->type . " with id [" . $this->id . "]");
$this->id = null;
$this->type = null;
$this->o = null;
$this->subtype = null;
}
}
return $sane;
}
示例4: paymentReturnAction
/**
* This Action can be called via Frontend
* @throws \CoreShop\Exception
* @throws \CoreShop\Exception\ObjectUnsupportedException
*/
public function paymentReturnAction()
{
$requestData = $this->parseRequestData();
$this->disableLayout();
$this->disableViewAutoRender();
\Pimcore\Logger::notice('OmniPay paymentReturn [Postfinance]. TransactionID: ' . $requestData['transaction'] . ', Status: ' . $requestData['status']);
$redirectUrl = '';
if ($requestData['status'] === 5) {
if (!empty($requestData['transaction'])) {
$cart = \CoreShop\Model\Cart::findByCustomIdentifier($requestData['transaction']);
if ($cart instanceof \CoreShop\Model\Cart) {
\Pimcore\Logger::notice('OmniPay paymentReturn [Postfinance]: create order with: ' . $requestData['transaction']);
$order = $cart->createOrder(\CoreShop\Model\Order\State::getById(\CoreShop\Model\Configuration::get("SYSTEM.ORDERSTATE.PAYMENT")), $this->getModule(), $cart->getTotal(), $this->view->language);
$payments = $order->getPayments();
foreach ($payments as $p) {
$dataBrick = new \Pimcore\Model\Object\Objectbrick\Data\CoreShopPaymentOmnipay($p);
$dataBrick->setTransactionId($requestData['transaction']);
$p->save();
}
$redirectUrl = Pimcore\Tool::getHostUrl() . $this->getModule()->getConfirmationUrl($order);
} else {
\Pimcore\Logger::notice('OmniPay paymentReturn [Postfinance]: Cart with identifier' . $requestData['transaction'] . 'not found');
$redirectUrl = Pimcore\Tool::getHostUrl() . $this->getModule()->getErrorUrl('cart with identifier' . $requestData['transaction'] . 'not found');
}
} else {
\Pimcore\Logger::notice('OmniPay paymentReturn [Postfinance]: No valid transaction id given');
$redirectUrl = Pimcore\Tool::getHostUrl() . $this->getModule()->getErrorUrl('no valid transaction id given');
}
} else {
\Pimcore\Logger::notice('OmniPay paymentReturn [Postfinance]: Error Status: ' . $requestData['status']);
$redirectUrl = Pimcore\Tool::getHostUrl() . $this->getModule()->getErrorUrl('Postfinance returned with an error. Error Status: ' . $requestData['status']);
}
$this->redirect($redirectUrl);
exit;
}
示例5: checkValidity
/**
* @return bool
*/
public function checkValidity()
{
$sane = true;
if (is_array($this->data) && $this->data["internal"]) {
if ($this->data["internalType"] == "document") {
$doc = Document::getById($this->data["internalId"]);
if (!$doc) {
$sane = false;
Logger::notice("Detected insane relation, removing reference to non existent document with id [" . $this->getDocumentId() . "]");
$new = Document\Tag::factory($this->getType(), $this->getName(), $this->getDocumentId());
$this->data = $new->getData();
}
} elseif ($this->data["internalType"] == "asset") {
$asset = Asset::getById($this->data["internalId"]);
if (!$asset) {
$sane = false;
Logger::notice("Detected insane relation, removing reference to non existent asset with id [" . $this->getDocumentId() . "]");
$new = Document\Tag::factory($this->getType(), $this->getName(), $this->getDocumentId());
$this->data = $new->getData();
}
}
}
return $sane;
}