Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Florian Semm
committed
Mar 31, 2012
1 parent
5572f01
commit ca1ce40
Showing
10 changed files
with
94 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
namespace FS\SolrBundle\Event\Listener; | ||
|
||
use FS\SolrBundle\Event\EventListenerInterface; | ||
use Symfony\Component\HttpKernel\Log\LoggerInterface; | ||
use FS\SolrBundle\Doctrine\Mapper\MetaInformation; | ||
|
||
abstract class AbstractLogListener implements EventListenerInterface { | ||
/** | ||
* | ||
* @var LoggerInterface | ||
*/ | ||
protected $logger = null; | ||
|
||
public function __construct(LoggerInterface $logger) { | ||
$this->logger = $logger; | ||
} | ||
|
||
protected function createDocumentNameWithId(MetaInformation $metaInformation) { | ||
return $metaInformation->getDocumentName().':'.$metaInformation->getEntityId(); | ||
} | ||
|
||
protected function createFieldList(MetaInformation $metaInformation) { | ||
return implode(', ', $metaInformation->getFields()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
namespace FS\SolrBundle\Event\Listener; | ||
|
||
use FS\SolrBundle\Doctrine\Mapper\MetaInformation; | ||
|
||
class DeleteLogListener extends AbstractLogListener { | ||
|
||
/* (non-PHPdoc) | ||
* @see FS\SolrBundle\Event.EventListenerInterface::notify() | ||
*/ | ||
public function notify(MetaInformation $metaInformation) { | ||
$nameWithId = $this->createDocumentNameWithId($metaInformation); | ||
$fieldList = $this->createFieldList($metaInformation); | ||
|
||
$this->logger->info(sprintf('%s with fields %s was deleted', $nameWithId, $fieldList)); | ||
} | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
namespace FS\SolrBundle\Event\Listener; | ||
|
||
use FS\SolrBundle\Doctrine\Mapper\MetaInformation; | ||
|
||
class InsertLogListener extends AbstractLogListener { | ||
|
||
/* (non-PHPdoc) | ||
* @see FS\SolrBundle\Event.EventListenerInterface::notify() | ||
*/ | ||
public function notify(MetaInformation $metaInformation) { | ||
$nameWithId = $this->createDocumentNameWithId($metaInformation); | ||
$fieldList = $this->createFieldList($metaInformation); | ||
|
||
$this->logger->info(sprintf('%s with fields %s was added', $nameWithId, $fieldList)); | ||
} | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
namespace FS\SolrBundle\Event\Listener; | ||
|
||
use FS\SolrBundle\Doctrine\Mapper\MetaInformation; | ||
use FS\SolrBundle\Event\Listener\AbstractLogListener; | ||
|
||
class UpdateLogListener extends AbstractLogListener { | ||
|
||
/* (non-PHPdoc) | ||
* @see FS\SolrBundle\Event.EventListenerInterface::notify() | ||
*/ | ||
public function notify(MetaInformation $metaInformation) { | ||
$nameWithId = $this->createDocumentNameWithId($metaInformation); | ||
$fieldList = $this->createFieldList($metaInformation); | ||
|
||
$this->logger->info(sprintf('%s with fields %s was updated', $nameWithId, $fieldList)); | ||
} | ||
} | ||
|
||
?> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters