945ea890c3c07fca378ee2a05353c00f24ef9175
[Packages/TYPO3.CMS.git] / typo3 / sysext / extensionmanager / Classes / Domain / Repository / RepositoryRepository.php
1 <?php
2 namespace TYPO3\CMS\Extensionmanager\Domain\Repository;
3
4 /***************************************************************
5 * Copyright notice
6 *
7 * (c) 2012 Susanne Moog, <susanne.moog@typo3.org>
8 * All rights reserved
9 *
10 * This script is part of the TYPO3 project. The TYPO3 project is
11 * free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * The GNU General Public License can be found at
17 * http://www.gnu.org/copyleft/gpl.html.
18 *
19 * This script is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * This copyright notice MUST APPEAR in all copies of the script!
25 ***************************************************************/
26 /**
27 * A repository for extension repositories
28 *
29 * @author Susanne Moog <typo3@susannemoog.de>
30 * @package Extension Manager
31 * @subpackage Repository
32 */
33 class RepositoryRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
34
35 /**
36 * Do not include pid in queries
37 *
38 * @return void
39 */
40 public function initializeObject() {
41 /** @var $defaultQuerySettings \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface */
42 $defaultQuerySettings = $this->objectManager->create('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface');
43 $defaultQuerySettings->setRespectStoragePage(FALSE);
44 $this->setDefaultQuerySettings($defaultQuerySettings);
45 }
46
47 /**
48 * Updates ExtCount and lastUpdated in Repository eg after import
49 *
50 * @param integer $extCount
51 * @param integer $uid
52 * @return void
53 */
54 public function updateRepositoryCount($extCount, $uid = 1) {
55 $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_extensionmanager_domain_model_repository', 'uid=' . intval($uid), array(
56 'last_update' => time(),
57 'extension_count' => intval($extCount)
58 ));
59 }
60
61 }
62
63
64 ?>