[TASK] Re-work/simplify copyright header in PHP files - Part 8
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Persistence / Generic / Storage / BackendInterface.php
1 <?php
2 namespace TYPO3\CMS\Extbase\Persistence\Generic\Storage;
3
4 /**
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16 /**
17 * Storage backend interface
18 */
19 interface BackendInterface {
20
21 /**
22 * Adds a row to the storage
23 *
24 * @param string $tableName The database table name
25 * @param array $fieldValues The fieldValues to insert
26 * @param boolean $isRelation TRUE if we are currently inserting into a relation table, FALSE by default
27 * @return integer the UID of the inserted row
28 */
29 public function addRow($tableName, array $fieldValues, $isRelation = FALSE);
30
31 /**
32 * Updates a row in the storage
33 *
34 * @param string $tableName The database table name
35 * @param array $fieldValues The fieldValues to update
36 * @param boolean $isRelation TRUE if we are currently inserting into a relation table, FALSE by default
37 * @return mixed|void
38 */
39 public function updateRow($tableName, array $fieldValues, $isRelation = FALSE);
40
41 /**
42 * Updates a relation row in the storage
43 *
44 * @param string $tableName The database relation table name
45 * @param array $fieldValues The fieldValues to be updated
46 * @return boolean
47 */
48 public function updateRelationTableRow($tableName, array $fieldValues);
49
50 /**
51 * Deletes a row in the storage
52 *
53 * @param string $tableName The database table name
54 * @param array $where An array of where array('fieldname' => value). This array will be transformed to a WHERE clause
55 * @param boolean $isRelation TRUE if we are currently inserting into a relation table, FALSE by default
56 * @return mixed|void
57 */
58 public function removeRow($tableName, array $where, $isRelation = FALSE);
59
60 /**
61 * Fetches maximal value for given table column
62 *
63 * @param string $tableName The database table name
64 * @param array $where An array of where array('fieldname' => value). This array will be transformed to a WHERE clause
65 * @param string $columnName column name to get the max value from
66 * @return mixed the max value
67 */
68 public function getMaxValueFromTable($tableName, array $where, $columnName);
69
70 /**
71 * Returns the number of items matching the query.
72 *
73 * @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
74 * @return integer
75 * @api
76 */
77 public function getObjectCountByQuery(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query);
78
79 /**
80 * Returns the object data matching the $query.
81 *
82 * @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
83 * @return array
84 * @api
85 */
86 public function getObjectDataByQuery(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query);
87
88 /**
89 * Checks if a Value Object equal to the given Object exists in the data base
90 *
91 * @param \TYPO3\CMS\Extbase\DomainObject\AbstractValueObject $object The Value Object
92 * @return mixed The matching uid if an object was found, else FALSE
93 * @todo this is the last monster in this persistence series. refactor!
94 */
95 public function getUidOfAlreadyPersistedValueObject(\TYPO3\CMS\Extbase\DomainObject\AbstractValueObject $object);
96 }