mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 23:13:15 +00:00
Replace app['phraseanet.appbox']->get_databox using trait
This commit is contained in:
@@ -82,7 +82,7 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
|
||||
public function __construct(Application $app, $sbas_id, $record_id, $number = null)
|
||||
{
|
||||
$this->app = $app;
|
||||
$this->databox = $this->app['phraseanet.appbox']->get_databox((int) $sbas_id);
|
||||
$this->databox = $this->app->findDataboxById((int) $sbas_id);
|
||||
$this->number = (int) $number;
|
||||
$this->record_id = (int) $record_id;
|
||||
|
||||
@@ -220,7 +220,7 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
|
||||
throw new Exception('unrecognized document type');
|
||||
}
|
||||
|
||||
$databox = $this->app['phraseanet.appbox']->get_databox($this->get_sbas_id());
|
||||
$databox = $this->app->findDataboxById($this->get_sbas_id());
|
||||
$connbas = $databox->get_connection();
|
||||
|
||||
$sql = 'UPDATE record SET type = :type WHERE record_id = :record_id';
|
||||
@@ -1083,7 +1083,7 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
|
||||
*/
|
||||
public function rebuild_subdefs()
|
||||
{
|
||||
$databox = $this->app['phraseanet.appbox']->get_databox($this->get_sbas_id());
|
||||
$databox = $this->app->findDataboxById($this->get_sbas_id());
|
||||
$connbas = $databox->get_connection();
|
||||
$sql = 'UPDATE record SET jeton=(jeton | ' . PhraseaTokens::MAKE_SUBDEF . ') WHERE record_id = :record_id';
|
||||
$stmt = $connbas->prepare($sql);
|
||||
@@ -1131,7 +1131,7 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
|
||||
*/
|
||||
public function write_metas()
|
||||
{
|
||||
$databox = $this->app['phraseanet.appbox']->get_databox($this->get_sbas_id());
|
||||
$databox = $this->app->findDataboxById($this->get_sbas_id());
|
||||
$connbas = $databox->get_connection();
|
||||
$sql = 'UPDATE record
|
||||
SET jeton = jeton | (' . (PhraseaTokens::WRITE_META_DOC | PhraseaTokens::WRITE_META_SUBDEF) . ')
|
||||
@@ -1150,7 +1150,7 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
|
||||
*/
|
||||
public function set_binary_status($status)
|
||||
{
|
||||
$databox = $this->app['phraseanet.appbox']->get_databox($this->get_sbas_id());
|
||||
$databox = $this->app->findDataboxById($this->get_sbas_id());
|
||||
$connbas = $databox->get_connection();
|
||||
|
||||
$sql = 'UPDATE record SET status = 0b' . $status . '
|
||||
@@ -1376,7 +1376,7 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
|
||||
*/
|
||||
public static function get_record_by_sha(Application $app, $sbas_id, $sha256, $record_id = null)
|
||||
{
|
||||
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
|
||||
$databox = $app->findDataboxById($sbas_id);
|
||||
$conn = $databox->get_connection();
|
||||
|
||||
$sql = "SELECT record_id
|
||||
@@ -1631,7 +1631,7 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
|
||||
|
||||
public function log_view($log_id, $referrer, $gv_sit)
|
||||
{
|
||||
$databox = $this->app['phraseanet.appbox']->get_databox($this->get_sbas_id());
|
||||
$databox = $this->app->findDataboxById($this->get_sbas_id());
|
||||
$connbas = $databox->get_connection();
|
||||
|
||||
$sql = 'INSERT INTO log_view (id, log_id, date, record_id, referrer, site_id)
|
||||
|
@@ -85,7 +85,7 @@ class record_exportElement extends record_adapter
|
||||
|
||||
$sbas_id = phrasea::sbasFromBas($this->app, $this->base_id);
|
||||
|
||||
$subdefgroups = $this->app['phraseanet.appbox']->get_databox($sbas_id)->get_subdef_structure();
|
||||
$subdefgroups = $this->app->findDataboxById($sbas_id)->get_subdef_structure();
|
||||
|
||||
$subdefs = [];
|
||||
|
||||
|
@@ -327,7 +327,7 @@ class record_preview extends record_adapter
|
||||
|
||||
$report = $this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_base($this->get_base_id(), 'canreport');
|
||||
|
||||
$databox = $this->app['phraseanet.appbox']->get_databox($this->get_sbas_id());
|
||||
$databox = $this->app->findDataboxById($this->get_sbas_id());
|
||||
$connsbas = $databox->get_connection();
|
||||
|
||||
$sql = 'SELECT d . * , l.user, l.usrid as usr_id, l.site
|
||||
@@ -431,7 +431,7 @@ class record_preview extends record_adapter
|
||||
AND site_id = :site
|
||||
GROUP BY datee ORDER BY datee ASC';
|
||||
|
||||
$databox = $this->app['phraseanet.appbox']->get_databox($this->get_sbas_id());
|
||||
$databox = $this->app->findDataboxById($this->get_sbas_id());
|
||||
$connsbas = $databox->get_connection();
|
||||
$stmt = $connsbas->prepare($sql);
|
||||
$stmt->execute(
|
||||
@@ -500,7 +500,7 @@ class record_preview extends record_adapter
|
||||
return $this->refferer_popularity;
|
||||
}
|
||||
|
||||
$databox = $this->app['phraseanet.appbox']->get_databox($this->get_sbas_id());
|
||||
$databox = $this->app->findDataboxById($this->get_sbas_id());
|
||||
$connsbas = $databox->get_connection();
|
||||
|
||||
$sql = 'SELECT count( id ) AS views, referrer
|
||||
@@ -594,7 +594,7 @@ class record_preview extends record_adapter
|
||||
AND site= :site
|
||||
GROUP BY datee ORDER BY datee ASC';
|
||||
|
||||
$databox = $this->app['phraseanet.appbox']->get_databox($this->get_sbas_id());
|
||||
$databox = $this->app->findDataboxById($this->get_sbas_id());
|
||||
$connsbas = $databox->get_connection();
|
||||
$stmt = $connsbas->prepare($sql);
|
||||
$stmt->execute(
|
||||
|
Reference in New Issue
Block a user