Skip to content

Commit efac96a

Browse files
committed
deprecated interfaces IRow & IRowContainer
1 parent eaba519 commit efac96a

File tree

6 files changed

+24
-76
lines changed

6 files changed

+24
-76
lines changed

src/Database/IRow.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
namespace Nette\Database;
1111

1212

13-
/**
14-
* Row interface.
15-
*/
13+
/** @deprecated use Row */
1614
interface IRow extends \Traversable, \ArrayAccess
1715
{
1816
}

src/Database/IRowContainer.php

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,38 +10,7 @@
1010
namespace Nette\Database;
1111

1212

13-
/**
14-
* Container of database result fetched into IRow.
15-
*/
13+
/** @deprecated use ResultSet */
1614
interface IRowContainer extends \Traversable
1715
{
18-
/**
19-
* Fetches single row object.
20-
*/
21-
function fetch(): ?IRow;
22-
23-
/**
24-
* Fetches single field.
25-
* @return mixed
26-
*/
27-
function fetchField();
28-
29-
/**
30-
* Fetches all rows as associative array.
31-
* @param string|int $key column name used for an array key or null for numeric index
32-
* @param string|int $value column name used for an array value or null for the whole row
33-
*/
34-
function fetchPairs($key = null, $value = null): array;
35-
36-
/**
37-
* Fetches all rows.
38-
* @return IRow[]
39-
*/
40-
function fetchAll(): array;
41-
42-
/**
43-
* Fetches all rows and returns associative tree.
44-
* @param string $path associative descriptor
45-
*/
46-
function fetchAssoc(string $path): array;
4716
}

src/Database/ResultSet.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ public function valid(): bool
226226
/********************* interface IRowContainer ****************d*g**/
227227

228228

229+
/**
230+
* Fetches single row object.
231+
*/
229232
public function fetch(): ?IRow
230233
{
231234
$data = $this->pdoStatement ? $this->pdoStatement->fetch() : null;
@@ -251,7 +254,8 @@ public function fetch(): ?IRow
251254

252255

253256
/**
254-
* @inheritDoc
257+
* Fetches single field.
258+
* @return mixed
255259
*/
256260
public function fetchField($column = 0)
257261
{
@@ -274,7 +278,9 @@ public function fetchFields(): ?array
274278

275279

276280
/**
277-
* @inheritDoc
281+
* Fetches all rows as associative array.
282+
* @param string|int $key column name used for an array key or null for numeric index
283+
* @param string|int $value column name used for an array value or null for the whole row
278284
*/
279285
public function fetchPairs($key = null, $value = null): array
280286
{
@@ -283,7 +289,8 @@ public function fetchPairs($key = null, $value = null): array
283289

284290

285291
/**
286-
* @inheritDoc
292+
* Fetches all rows.
293+
* @return Row[]
287294
*/
288295
public function fetchAll(): array
289296
{
@@ -295,7 +302,8 @@ public function fetchAll(): array
295302

296303

297304
/**
298-
* @inheritDoc
305+
* Fetches all rows and returns associative tree.
306+
* @param string $path associative descriptor
299307
*/
300308
public function fetchAssoc(string $path): array
301309
{

src/Database/Table/IRow.php

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,7 @@
1212
use Nette\Database;
1313

1414

15-
/**
16-
* Row interface.
17-
*/
15+
/** @deprecated use ActiveRow */
1816
interface IRow extends Database\IRow
1917
{
20-
function setTable(Selection $name);
21-
22-
function getTable(): Selection;
23-
24-
/**
25-
* Returns primary key value.
26-
* @return mixed
27-
*/
28-
function getPrimary(bool $throw = true);
29-
30-
/**
31-
* Returns row signature (composition of primary keys)
32-
*/
33-
function getSignature(bool $throw = true): string;
34-
35-
/**
36-
* Returns referencing rows.
37-
*/
38-
function related(string $key, string $throughColumn = null): GroupedSelection;
39-
40-
/**
41-
* Returns referenced row.
42-
*/
43-
function ref(string $key, string $throughColumn = null): ?self;
4418
}

src/Database/Table/IRowContainer.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,7 @@
1212
use Nette\Database;
1313

1414

15-
/**
16-
* Container of database result fetched into IRow objects.
17-
*
18-
* @method IRow|null fetch() Fetches single row object.
19-
* @method IRow[] fetchAll() Fetches all rows.
20-
*/
15+
/** @deprecated use Selection */
2116
interface IRowContainer extends Database\IRowContainer
2217
{
2318
}

src/Database/Table/Selection.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public function get($key): ?ActiveRow
200200

201201

202202
/**
203-
* @inheritDoc
203+
* Fetches single row object.
204204
* @return ActiveRow|null if there is no such row
205205
*/
206206
public function fetch(): ?Nette\Database\IRow
@@ -233,7 +233,9 @@ public function fetchField(string $column = null)
233233

234234

235235
/**
236-
* @inheritDoc
236+
* Fetches all rows as associative array.
237+
* @param string|int $key column name used for an array key or null for numeric index
238+
* @param string|int $value column name used for an array value or null for the whole row
237239
*/
238240
public function fetchPairs($key = null, $value = null): array
239241
{
@@ -242,7 +244,8 @@ public function fetchPairs($key = null, $value = null): array
242244

243245

244246
/**
245-
* @inheritDoc
247+
* Fetches all rows.
248+
* @return ActiveRow[]
246249
*/
247250
public function fetchAll(): array
248251
{
@@ -251,7 +254,8 @@ public function fetchAll(): array
251254

252255

253256
/**
254-
* @inheritDoc
257+
* Fetches all rows and returns associative tree.
258+
* @param string $path associative descriptor
255259
*/
256260
public function fetchAssoc(string $path): array
257261
{

0 commit comments

Comments
 (0)