mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 11:33:17 +00:00
[SearchEngine] CS cleanup
This commit is contained in:
@@ -7,7 +7,6 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
interface ConfigurationPanelInterface
|
||||
{
|
||||
|
||||
public function get(Application $app, Request $request);
|
||||
|
||||
public function post(Application $app, Request $request);
|
||||
|
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace Alchemy\Phrasea\SearchEngine\Phrasea;
|
||||
|
||||
use Alchemy\Phrasea\Application;
|
||||
use Alchemy\Phrasea\SearchEngine\ConfigurationPanelInterface;
|
||||
use Silex\Application;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class ConfigurationPanel implements ConfigurationPanelInterface
|
||||
@@ -18,7 +18,6 @@ class ConfigurationPanel implements ConfigurationPanelInterface
|
||||
|
||||
public function get(Application $app, Request $request)
|
||||
{
|
||||
|
||||
return $app['twig']->render('admin/search-engine/phrasea.html.twig', array());
|
||||
}
|
||||
|
||||
@@ -26,5 +25,4 @@ class ConfigurationPanel implements ConfigurationPanelInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -16,8 +16,6 @@ use Alchemy\Phrasea\SearchEngine\SearchEngineOptions;
|
||||
use Alchemy\Phrasea\SearchEngine\SearchEngineResult;
|
||||
use Alchemy\Phrasea\Exception\RuntimeException;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Silex\Application;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class PhraseaEngine implements SearchEngineInterface
|
||||
{
|
||||
|
@@ -15,8 +15,6 @@ use Alchemy\Phrasea\SearchEngine\SearchEngineOptions;
|
||||
use Alchemy\Phrasea\SearchEngine\SearchEngineResult;
|
||||
use Alchemy\Phrasea\Exception\RuntimeException;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Silex\Application;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
interface SearchEngineInterface
|
||||
{
|
||||
|
@@ -285,17 +285,20 @@ class SearchEngineOptions implements \Serializable
|
||||
{
|
||||
$tmp = array();
|
||||
foreach ($status as $n => $options) {
|
||||
if (count($options) > 1)
|
||||
if (count($options) > 1) {
|
||||
continue;
|
||||
}
|
||||
if (isset($options['on'])) {
|
||||
foreach ($options['on'] as $sbas_id)
|
||||
foreach ($options['on'] as $sbas_id) {
|
||||
$tmp[$n][$sbas_id] = 1;
|
||||
}
|
||||
}
|
||||
if (isset($options['off'])) {
|
||||
foreach ($options['off'] as $sbas_id)
|
||||
foreach ($options['off'] as $sbas_id) {
|
||||
$tmp[$n][$sbas_id] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->status = $tmp;
|
||||
|
||||
@@ -383,7 +386,7 @@ class SearchEngineOptions implements \Serializable
|
||||
public function setMaxDate($max_date)
|
||||
{
|
||||
if (!is_null($max_date) && trim($max_date) !== '') {
|
||||
$this->date_max = DateTime::createFromFormat('Y/m/d H:i:s', $max_date . ' 23:59:59');
|
||||
$this->date_max = \DateTime::createFromFormat('Y/m/d H:i:s', $max_date . ' 23:59:59');
|
||||
}
|
||||
|
||||
return $this;
|
||||
@@ -427,7 +430,7 @@ class SearchEngineOptions implements \Serializable
|
||||
{
|
||||
$ret = array();
|
||||
foreach ($this as $key => $value) {
|
||||
if ($value instanceof DateTime) {
|
||||
if ($value instanceof \DateTime) {
|
||||
$value = $value->format('d-m-Y h:i:s');
|
||||
}
|
||||
if (in_array($key, array('collections', 'business_fields'))) {
|
||||
|
Reference in New Issue
Block a user