/** * @param string $message * @param mixed $pattern * @param mixed $replacement */ protected function log(&$message, $pattern = array('/email=(.*[^&])&password=(.*[^&])&/'), $replacement = array('email=xxxxxx&password=yyyyyy&')) { if (null !== $this->logger) { if (null !== $pattern && null !== $replacement) { $message = preg_replace($pattern, $replacement, $message); } $this->logger->debug($message); } }
public function denormalize() { $this->_loadLogger(); $this->_loadAttributeDefinitions(); $newAttributes = array(); foreach ($this->_attributes as $attributeName => $attributeValues) { $newAttributes[$attributeName] = $attributeValues; // Not defined in SURFconext attributes... can't find any aliases. if (!isset($this->_definitions[$attributeName])) { $this->_logger->debug("Attribute Denormalization: Don't have a definition for '{$attributeName}', unable to add any aliases"); continue; } $aliases = $this->_getAliasesForAttribute($attributeName); // And add the values for those aliases foreach ($aliases as $aliasName) { $this->_logger->debug("Attribute Denormalization: Adding alias '{$aliasName}' for '{$attributeName}'"); $newAttributes[$aliasName] = $attributeValues; } } return $newAttributes; }
/** * Association d'un Intent et d'un paiement, avec envoie des evenements * @since 1.0.0 * @param mixed $intentId integer si intentId est false alors nous avons un payment orphelin. * @param Ecedi\Donate\CoreBundle\Entity\Payment $payment une instance de payment * @todo flush is not right here, it should be in the controller * */ public function attachPayment($intentId, Payment $payment) { $intentRepository = $this->getDoctrine()->getRepository('DonateCoreBundle:Intent'); $em = $this->getDoctrine()->getManager(); if ($intentId && ($intent = $intentRepository->find($intentId))) { $intent->addPayment($payment); $this->logger->debug('addPayment to intent'); if ($intent->getType() == Intent::TYPE_SPOT && $intent->getStatus() == Intent::STATUS_PENDING) { //Propagation de l'état du paiement vers l'intent $intent->setStatus(Intent::STATUS_DONE); $this->logger->debug('set intent status to DONE'); } else { //on reçoit plusieurs post-sale pour le même spot order... $this->logger->notice('another post sale for this intent'); } $em->persist($intent); } $this->dispatchPaymentStatusEvent($payment); $em->persist($payment); $em->flush(); }