-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#35 integrate fixture search by tags
- Loading branch information
Showing
10 changed files
with
225 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace System25\T3sports\Model; | ||
|
||
use Sys25\RnBase\Domain\Model\BaseModel; | ||
|
||
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2010-2024 Rene Nitzsche ([email protected]) | ||
* 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! | ||
***************************************************************/ | ||
|
||
class Tag extends BaseModel | ||
{ | ||
public function getTableName() | ||
{ | ||
return 'tx_t3sportstats_tags'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace System25\T3sports\Repository; | ||
|
||
use Sys25\RnBase\Domain\Repository\PersistenceRepository; | ||
use System25\T3sports\Search\TagSearch; | ||
|
||
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2017-2024 Rene Nitzsche ([email protected]) | ||
* 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! | ||
***************************************************************/ | ||
|
||
/** | ||
* @author Rene Nitzsche | ||
*/ | ||
class TagRepository extends PersistenceRepository | ||
{ | ||
public function getSearchClass() | ||
{ | ||
return TagSearch::class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<?php | ||
|
||
namespace System25\T3sports\Search; | ||
|
||
use Sys25\RnBase\Database\Query\Join; | ||
use Sys25\RnBase\Search\SearchBase; | ||
use Sys25\RnBase\Utility\Misc; | ||
use System25\T3sports\Model\Tag; | ||
|
||
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2010-2024 Rene Nitzsche | ||
* Contact: [email protected] | ||
* All rights reserved | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2.1 of the License, or (at your option) any later version. | ||
* | ||
* This library 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 | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this library; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
***************************************************************/ | ||
|
||
/** | ||
* Class to search player stats from database. | ||
* | ||
* @author Rene Nitzsche | ||
*/ | ||
class TagSearch extends SearchBase | ||
{ | ||
protected function getTableMappings() | ||
{ | ||
$tableMapping = []; | ||
$tableMapping['TAG'] = $this->getBaseTable(); | ||
$tableMapping['SERIES_SCOPE_MM'] = 'tx_t3sportstats_series_scope_mm'; | ||
$tableMapping['SERIES'] = 'tx_t3sportstats_series'; | ||
|
||
// Hook to append other tables | ||
Misc::callHook('t3sportstats', 'search_Tags_getTableMapping_hook', [ | ||
'tableMapping' => &$tableMapping, | ||
], $this); | ||
|
||
return $tableMapping; | ||
} | ||
|
||
protected function getBaseTableAlias() | ||
{ | ||
return 'TAG'; | ||
} | ||
|
||
protected function getBaseTable() | ||
{ | ||
return 'tx_t3sportstats_tags'; | ||
} | ||
|
||
public function getWrapperClass() | ||
{ | ||
return Tag::class; | ||
} | ||
|
||
protected function getJoins($tableAliases) | ||
{ | ||
$join = []; | ||
if (isset($tableAliases['SERIES']) || isset($tableAliases['SERIES_SCOPE_MM'])) { | ||
$join[] = new Join('TAG', 'tx_t3sportstats_series_scope_mm', 'TAG.uid = SERIES_SCOPE_MM.uid_foreign AND SERIES_SCOPE_MM.tablenames=\'tx_t3sportstats_tags\'', 'SERIES_SCOPE_MM'); | ||
} | ||
|
||
if (isset($tableAliases['SERIES'])) { | ||
$join[] = new Join('SERIES_SCOPE_MM', 'tx_t3sportstats_series', 'SERIES.uid = SERIES_SCOPE_MM.uid_local', 'SERIES'); | ||
} | ||
|
||
// Hook to append other tables | ||
Misc::callHook('t3sportstats', 'search_Tags_getJoins_hook', [ | ||
'join' => &$join, | ||
'tableAliases' => $tableAliases, | ||
], $this); | ||
|
||
return $join; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.