Commit e1587a31 authored by flyguide's avatar flyguide

fix indentation

git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/terfe/branches/ter_fe2@64109 735d13b6-9817-0410-8766-e36946ffe9aa
parent b96805c2
<?php
/*******************************************************************
* Copyright notice
*
* (c) 2011 Kai Vogel <kai.vogel@speedprogs.de>, Speedprogs.de
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
******************************************************************/
/*******************************************************************
* Copyright notice
*
* (c) 2011 Kai Vogel <kai.vogel@speedprogs.de>, Speedprogs.de
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
******************************************************************/
/**
* Abstract repository
*/
abstract class Tx_TerFe2_Domain_Repository_AbstractRepository extends Tx_Extbase_Persistence_Repository {
/**
* Abstract repository
* Returns a query for objects of this repository
*
* @param string $offset Offset to start with
* @param string $count Count of result
* @param array $ordering Ordering <-> Direction
* @return Tx_Extbase_Persistence_QueryInterface
*/
abstract class Tx_TerFe2_Domain_Repository_AbstractRepository extends Tx_Extbase_Persistence_Repository {
/**
* Returns a query for objects of this repository
*
* @param string $offset Offset to start with
* @param string $count Count of result
* @param array $ordering Ordering <-> Direction
* @return Tx_Extbase_Persistence_QueryInterface
*/
public function createQuery($offset = 0, $count = 0, array $ordering = array()) {
$query = parent::createQuery();
public function createQuery($offset = 0, $count = 0, array $ordering = array()) {
$query = parent::createQuery();
if (!empty($offset)) {
$query->setOffset((int) $offset);
}
if (!empty($count)) {
$query->setLimit((int) $count);
}
if (!empty($offset)) {
$query->setOffset((int) $offset);
}
if (!empty($ordering)) {
$query->setOrderings($ordering);
}
if (!empty($count)) {
$query->setLimit((int) $count);
}
return $query;
if (!empty($ordering)) {
$query->setOrderings($ordering);
}
return $query;
}
/**
* Returns random objects from db
*
* @param integer $limit Limit of the results
* @return Tx_Extbase_Persistence_ObjectStorage Objects
*/
public function findRandom($limit) {
$query = $this->createQuery(0, $limit);
// Workaround for random ordering while Extbase doesn't support this
// See: http://lists.typo3.org/pipermail/typo3-project-typo3v4mvc/2010-July/005870.html
$backend = $this->objectManager->get('Tx_Extbase_Persistence_Storage_Typo3DbBackend');
$parameters = array();
$statementParts = $backend->parseQuery($query, $parameters);
$statementParts['orderings'][] = ' RAND()';
$statement = $backend->buildQuery($statementParts, $parameters);
$query->statement($statement, $parameters);
/**
* Returns random objects from db
*
* @param integer $limit Limit of the results
* @return Tx_Extbase_Persistence_ObjectStorage Objects
*/
public function findRandom($limit) {
$query = $this->createQuery(0, $limit);
return $query->execute();
}
// Workaround for random ordering while Extbase doesn't support this
// See: http://lists.typo3.org/pipermail/typo3-project-typo3v4mvc/2010-July/005870.html
$backend = $this->objectManager->get('Tx_Extbase_Persistence_Storage_Typo3DbBackend');
$parameters = array();
$statementParts = $backend->parseQuery($query, $parameters);
$statementParts['orderings'][] = ' RAND()';
$statement = $backend->buildQuery($statementParts, $parameters);
$query->statement($statement, $parameters);
return $query->execute();
}
/**
* Returns all objects
*
* @param string $offset Offset to start with
* @param string $count Count of result
* @param string $ordering Ordering <-> Direction
* @return Tx_Extbase_Persistence_ObjectStorage Objects
*/
public function findAll($offset = 0, $count = 0, array $ordering = array()) {
$query = $this->createQuery($offset, $count, $ordering);
return $query->execute();
}
/**
* Returns all objects
*
* @param string $offset Offset to start with
* @param string $count Count of result
* @param string $ordering Ordering <-> Direction
* @return Tx_Extbase_Persistence_ObjectStorage Objects
*/
public function findAll($offset = 0, $count = 0, array $ordering = array()) {
$query = $this->createQuery($offset, $count, $ordering);
return $query->execute();
}
}
?>
\ No newline at end of file
<?php
/*******************************************************************
* Copyright notice
*
* (c) 2011 Kai Vogel <kai.vogel@speedprogs.de>, Speedprogs.de
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
******************************************************************/
/*******************************************************************
* Copyright notice
*
* (c) 2011 Kai Vogel <kai.vogel@speedprogs.de>, Speedprogs.de
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
******************************************************************/
/**
* Repository for Tx_TerFe2_Domain_Model_Author
*/
class Tx_TerFe2_Domain_Repository_AuthorRepository extends Tx_TerFe2_Domain_Repository_AbstractRepository {
/**
* Repository for Tx_TerFe2_Domain_Model_Author
* Returns the authors from latest extension versions
*
* @return Tx_Extbase_Persistence_ObjectStorage Author objects
*/
class Tx_TerFe2_Domain_Repository_AuthorRepository extends Tx_TerFe2_Domain_Repository_AbstractRepository {
/**
* Returns the authors from latest extension versions
*
* @return Tx_Extbase_Persistence_ObjectStorage Author objects
*/
public function findByLatestExtensionVersion() {
$statement = '
SELECT author FROM tx_terfe2_domain_model_version RIGHT JOIN tx_terfe2_domain_model_extension ON (
tx_terfe2_domain_model_version.uid = tx_terfe2_domain_model_extension.last_version
)
';
// Workaround while extbase doesn't support JOIN
$query = $this->createQuery();
$query->getQuerySettings()->setReturnRawQueryResult(TRUE);
$query->statement($statement, array());
$rows = $query->execute();
unset($query);
public function findByLatestExtensionVersion() {
$statement = '
SELECT author FROM tx_terfe2_domain_model_version RIGHT JOIN tx_terfe2_domain_model_extension ON (
tx_terfe2_domain_model_version.uid = tx_terfe2_domain_model_extension.last_version
)
';
// Workaround to enable paginate
$uids = array();
foreach ($rows as $row) {
$uids[] = (int) $row['author'];
}
$query = $this->createQuery();
$query->setOrderings(
array('name' => Tx_Extbase_Persistence_QueryInterface::ORDER_ASCENDING)
);
$query->matching($query->in('uid', $uids));
// Workaround while extbase doesn't support JOIN
$query = $this->createQuery();
$query->getQuerySettings()->setReturnRawQueryResult(TRUE);
$query->statement($statement, array());
$rows = $query->execute();
unset($query);
return $query->execute();
// Workaround to enable paginate
$uids = array();
foreach ($rows as $row) {
$uids[] = (int) $row['author'];
}
$query = $this->createQuery();
$query->setOrderings(
array('name' => Tx_Extbase_Persistence_QueryInterface::ORDER_ASCENDING)
);
$query->matching($query->in('uid', $uids));
return $query->execute();
}
/**
* Returns all matching records by combination of email and name
*
* @param string $email
* @param string $name
*
* @return matching records
*/
public function findByEmailAndName($email, $name) {
$query = $this->createQuery();
$query->matching(
$query->logicalAnd(
array(
$query->equals('email', $email),
$query->equals('name', $name)
)
/**
* Returns all matching records by combination of email and name
*
* @param string $email
* @param string $name
*
* @return matching records
*/
public function findByEmailAndName($email, $name) {
$query = $this->createQuery();
$query->matching(
$query->logicalAnd(
array(
$query->equals('email', $email),
$query->equals('name', $name)
)
);
)
);
return $query->execute();
}
return $query->execute();
}
/**
* Returns author with matching email, name and username
*
* @param array $authorRow
* @return array|Tx_Extbase_Persistence_QueryResultInterface
*/
public function findByAuthorData($authorRow) {
$query = $this->createQuery();
$query->getQuerySettings()->setRespectStoragePage(FALSE);
$query->getQuerySettings()->setRespectSysLanguage(FALSE);
$query->matching(
$query->logicalAnd(
$query->equals('email', $authorRow['email']),
$query->equals('name', $authorRow['name']),
$query->equals('username', $authorRow['username'])
)
);
return $query->execute();
}
/**
* Returns author with matching email, name and username
*
* @param array $authorRow
* @return array|Tx_Extbase_Persistence_QueryResultInterface
*/
public function findByAuthorData($authorRow) {
$query = $this->createQuery();
$query->getQuerySettings()->setRespectStoragePage(FALSE);
$query->getQuerySettings()->setRespectSysLanguage(FALSE);
$query->matching(
$query->logicalAnd(
$query->equals('email', $authorRow['email']),
$query->equals('name', $authorRow['name']),
$query->equals('username', $authorRow['username'])
)
);
return $query->execute();
}
}
?>
\ No newline at end of file
<?php
/*******************************************************************
* Copyright notice
*
* (c) 2011 Kai Vogel <kai.vogel@speedprogs.de>, Speedprogs.de
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
******************************************************************/
/*******************************************************************
* Copyright notice
*
* (c) 2011 Kai Vogel <kai.vogel@speedprogs.de>, Speedprogs.de
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
******************************************************************/
/**
* Repository for Tx_TerFe2_Domain_Model_Category
*/
class Tx_TerFe2_Domain_Repository_CategoryRepository extends Tx_TerFe2_Domain_Repository_AbstractRepository {
/**
* Repository for Tx_TerFe2_Domain_Model_Category
*/
class Tx_TerFe2_Domain_Repository_CategoryRepository extends Tx_TerFe2_Domain_Repository_AbstractRepository {
}
}
?>
\ No newline at end of file
<?php
/*******************************************************************
* Copyright notice
*
* (c) 2011 Kai Vogel <kai.vogel@speedprogs.de>, Speedprogs.de
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
******************************************************************/
/*******************************************************************
* Copyright notice
*
* (c) 2011 Kai Vogel <kai.vogel@speedprogs.de>, Speedprogs.de
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
******************************************************************/
/**
* Repository for Tx_TerFe2_Domain_Model_ExtensionManagerCacheEntry
*/
class Tx_TerFe2_Domain_Repository_ExtensionManagerCacheEntryRepository extends Tx_TerFe2_Domain_Repository_AbstractRepository {
/**
* Repository for Tx_TerFe2_Domain_Model_ExtensionManagerCacheEntry
* Get all updated extension rows
*
* @param integer $lastUpdateDate Date of the last update
* @param integer $offset Offset to start with
* @param integer $count Extension count to load
* @return array Objects
*/
class Tx_TerFe2_Domain_Repository_ExtensionManagerCacheEntryRepository extends Tx_TerFe2_Domain_Repository_AbstractRepository {
/**
* Get all updated extension rows
*
* @param integer $lastUpdateDate Date of the last update
* @param integer $offset Offset to start with
* @param integer $count Extension count to load
* @return array Objects
*/
public function findLastUpdated($lastUpdateDate, $offset = 0, $count = 0) {
$query = $this->createQuery($offset, $count);
$query->getQuerySettings()->setRespectStoragePage(FALSE);
$query->getQuerySettings()->setRespectSysLanguage(FALSE);
$query->getQuerySettings()->setReturnRawQueryResult(TRUE);
$query->matching($query->greaterThan('lastuploaddate', (int) $lastUpdateDate));
return $query->execute();
}
public function findLastUpdated($lastUpdateDate, $offset = 0, $count = 0) {
$query = $this->createQuery($offset, $count);
$query->getQuerySettings()->setRespectStoragePage(FALSE);
$query->getQuerySettings()->setRespectSysLanguage(FALSE);
$query->getQuerySettings()->setReturnRawQueryResult(TRUE);
$query->matching($query->greaterThan('lastuploaddate', (int) $lastUpdateDate));
return $query->execute();
}
/**
* Returns one extension row by given extKey and versionString
*
* @param string $extKey Extension Key
* @param string $versionString Version of the extension
* @return array Objects
*/
public function findOneByExtKeyAndVersionString($extKey, $versionString) {
$query = $this->createQuery(0, 1);
$query->getQuerySettings()->setRespectStoragePage(FALSE);
$query->getQuerySettings()->setRespectSysLanguage(FALSE);
$query->getQuerySettings()->setReturnRawQueryResult(TRUE);
$query->matching(
$query->logicalAnd(
$query->equals('extkey', $extKey),
$query->equals('version', $versionString)
)
);
$rows = $query->execute();
if (is_array($rows)) {
return reset($rows);
}
/**
* Returns one extension row by given extKey and versionString
*
* @param string $extKey Extension Key
* @param string $versionString Version of the extension
* @return array Objects
*/
public function findOneByExtKeyAndVersionString($extKey, $versionString) {
$query = $this->createQuery(0, 1);
$query->getQuerySettings()->setRespectStoragePage(FALSE);
$query->getQuerySettings()->setRespectSysLanguage(FALSE);
$query->getQuerySettings()->setReturnRawQueryResult(TRUE);
$query->matching(
$query->logicalAnd(
$query->equals('extkey', $extKey),
$query->equals('version', $versionString)
)
);
return array();
$rows = $query->execute();
if (is_array($rows)) {
return reset($rows);
}
return array();
}
}
?>
\ No newline at end of file
<?php
/* * *****************************************************************
/*******************************************************************
* Copyright notice
*
* (c) 2011 Kai Vogel <kai.vogel@speedprogs.de>, Speedprogs.de
......@@ -22,7 +21,7 @@
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
* **************************************************************** */
******************************************************************/
/**
* Repository for Tx_TerFe2_Domain_Model_Extension
......@@ -192,7 +191,7 @@ class Tx_TerFe2_Domain_Repository_ExtensionRepository extends Tx_TerFe2_Domain_R
}
/**
*
*
* @param string $frontendUser
* @return Tx_Extbase_Persistence_ObjectStorage Objects
*/
......
<?php
/*******************************************************************
* Copyright notice
*
* (c) 2011 Kai Vogel <kai.vogel@speedprogs.de>, Speedprogs.de
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
******************************************************************/
/*******************************************************************
* Copyright notice
*
* (c) 2011 Kai Vogel <kai.vogel@speedprogs.de>, Speedprogs.de
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
******************************************************************/
/**
* Repository for Tx_TerFe2_Domain_Model_Media
*/
class Tx_TerFe2_Domain_Repository_MediaRepository extends Tx_TerFe2_Domain_Repository_AbstractRepository {
/**
* Repository for Tx_TerFe2_Domain_Model_Media
*/
class Tx_TerFe2_Domain_Repository_MediaRepository extends Tx_TerFe2_Domain_Repository_AbstractRepository {
}
}
?>
\ No newline at end of file
<?php
/*******************************************************************
* Copyright notice
*
* (c) 2011 Kai Vogel <kai.vogel@speedprogs.de>, Speedprogs.de
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
******************************************************************/
/*******************************************************************
* Copyright notice
*
* (c) 2011 Kai Vogel <kai.vogel@speedprogs.de>, Speedprogs.de
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
******************************************************************/
/**
* Repository for Tx_TerFe2_Domain_Model_Search
*/
class Tx_TerFe2_Domain_Repository_SearchRepository extends Tx_TerFe2_Domain_Repository_AbstractRepository {
/**
* Repository for Tx_TerFe2_Domain_Model_Search
* Search extension uids by search words and filters
*