<?php
namespace App\Service;
class DocumentManagerServices
{
protected $documentmanager;
public function __construct($documentmanager)
{
$this->documentmanager = $documentmanager;
}
public function getPageListLength($locale, $template)
{
$liste_page = $this->documentmanager->createQuery('SELECT * FROM [nt:unstructured] WHERE [jcr:mixinTypes] = "sulu:page" AND [i18n:' . $locale . '-template] = "' . $template . '" AND [i18n:' . $locale . '-state] = "2"');
$queryResult = $liste_page->execute();
return sizeof($queryResult);
}
}