Skip to content

Commit c762dd6

Browse files
committed
fix invalid syntax
1 parent b71dd8e commit c762dd6

File tree

40 files changed

+90
-90
lines changed

40 files changed

+90
-90
lines changed

docs/general-concepts/database/delete-data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Deleting a Record
99
Use the delete method to remove records from the database.
1010

1111
```php
12-
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface:class);
12+
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
1313

1414
$query = $db->createQuery();
1515

docs/general-concepts/database/insert-data.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ use Joomla\CMS\Factory;
2323
$db = $this->getDatabase();
2424

2525
// When used in other places
26-
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface:class);
26+
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
2727

28-
$query = $db->createQuery(true);
28+
$query = $db->createQuery();
2929
```
3030

3131
:::warning[Developer Note]
@@ -61,7 +61,7 @@ $profile_value = 'Inserting a record using insert()';
6161
$ordering = 1;
6262

6363
// Get a db connection.
64-
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface:class);
64+
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
6565

6666
// Create a new query object.
6767
$query = $db->createQuery();
@@ -102,7 +102,7 @@ $profile->profile_value='Inserting a record using insertObject()';
102102
$profile->ordering=1;
103103

104104
// Insert the object into the user profile table.
105-
$result = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface:class)->insertObject('#__user_profiles', $profile);
105+
$result = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class)->insertObject('#__user_profiles', $profile);
106106
```
107107

108108
Notice here that we do not need to escape the table name; the `insertObject` method does this for us.

docs/general-concepts/database/query-results.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This is often the result of a 'count' query to get the number of records:
2525

2626
```php
2727
use Joomla\CMS\Factory;
28-
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface:class);
28+
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
2929
$query = $db->createQuery();
3030
$query->select('COUNT(*)');
3131
$query->from($db->quoteName('#__my_table'));
@@ -42,7 +42,7 @@ or where you are just looking for a single field from a single row of the table
4242

4343
```php
4444
use Joomla\CMS\Factory;
45-
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface:class);
45+
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
4646
$query = $db->createQuery();
4747
$query->select('field_name');
4848
$query->from($db->quoteName('#__my_table'));

docs/general-concepts/database/select-data.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use Joomla\CMS\Factory;
1919
$db = $this->getDatabase();
2020

2121
// When used in other places
22-
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface:class);
22+
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
2323

2424
$query = $db->createQuery();
2525
```
@@ -51,7 +51,7 @@ easily readable and portable:
5151
use Joomla\CMS\Factory;
5252

5353
// Get a db connection.
54-
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface:class);
54+
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
5555

5656
// Create a new query object.
5757
$query = $db->createQuery();
@@ -117,7 +117,7 @@ Also note that the table alias is used in all methods which reference table colu
117117
use Joomla\CMS\Factory;
118118

119119
// Get a db connection.
120-
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface:class);
120+
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
121121

122122
// Create a new query object.
123123
$query = $db->createQuery();

docs/general-concepts/database/update-data.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The `DatabaseQuery` class also provides methods for building update queries, in
1212
update and set. We also reuse another method which we used when creating select statements, the where method.
1313

1414
```php
15-
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface:class);
15+
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
1616

1717
$query = $db->createQuery();
1818

@@ -57,7 +57,7 @@ $object->title = 'My Custom Record';
5757
$object->description = 'A custom record being updated in the database.';
5858

5959
// Update their details in the users table using id as the primary key.
60-
$result = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface:class)->updateObject('#__custom_table', $object, 'id');
60+
$result = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class)->updateObject('#__custom_table', $object, 'id');
6161
```
6262

6363
Just like `insertObject`, `updateObject` takes care of escaping table names for us.

versioned_docs/version-4.4/general-concepts/database/delete-data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ title: Delete Data from the Database
88
Use the delete method to remove records from the database.
99

1010
```php
11-
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface:class);
11+
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
1212

1313
$query = $db->getQuery(true);
1414

versioned_docs/version-4.4/general-concepts/database/insert-data.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use Joomla\CMS\Factory;
2020
$db = $this->getDatabase();
2121

2222
// When used in other places
23-
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface:class);
23+
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
2424

2525
$query = $db->getQuery(true);
2626
```
@@ -49,7 +49,7 @@ the most common being insert, columns and values.
4949

5050
```php
5151
// Get a db connection.
52-
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface:class);
52+
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
5353

5454
// Create a new query object.
5555
$query = $db->getQuery(true);
@@ -90,7 +90,7 @@ $profile->profile_value='Inserting a record using insertObject()';
9090
$profile->ordering=1;
9191

9292
// Insert the object into the user profile table.
93-
$result = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface:class)->insertObject('#__user_profiles', $profile);
93+
$result = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class)->insertObject('#__user_profiles', $profile);
9494
```
9595

9696
Notice here that we do not need to escape the table name; the `insertObject` method does this for us.

versioned_docs/version-4.4/general-concepts/database/query-results.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ This is often the result of a 'count' query to get the number of records:
2424

2525
```php
2626
use Joomla\CMS\Factory;
27-
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface:class);
27+
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
2828
$query = $db->getQuery(true);
2929
$query->select('COUNT(*)');
3030
$query->from($db->quoteName('#__my_table'));
@@ -41,7 +41,7 @@ or where you are just looking for a single field from a single row of the table
4141

4242
```php
4343
use Joomla\CMS\Factory;
44-
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface:class);
44+
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
4545
$query = $db->getQuery(true);
4646
$query->select('field_name');
4747
$query->from($db->quoteName('#__my_table'));

versioned_docs/version-4.4/general-concepts/database/select-data.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use Joomla\CMS\Factory;
1818
$db = $this->getDatabase();
1919

2020
// When used in other places
21-
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface:class);
21+
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
2222

2323
$query = $db->getQuery(true);
2424
```
@@ -50,7 +50,7 @@ easily readable and portable:
5050
use Joomla\CMS\Factory;
5151

5252
// Get a db connection.
53-
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface:class);
53+
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
5454

5555
// Create a new query object.
5656
$query = $db->getQuery(true);
@@ -116,7 +116,7 @@ Also note that the table alias is used in all methods which reference table colu
116116
use Joomla\CMS\Factory;
117117

118118
// Get a db connection.
119-
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface:class);
119+
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
120120

121121
// Create a new query object.
122122
$query = $db->getQuery(true);

versioned_docs/version-4.4/general-concepts/database/update-data.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The `DatabaseQuery` class also provides methods for building update queries, in
1111
update and set. We also reuse another method which we used when creating select statements, the where method.
1212

1313
```php
14-
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface:class);
14+
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
1515

1616
$query = $db->getQuery(true);
1717

@@ -56,7 +56,7 @@ $object->title = 'My Custom Record';
5656
$object->description = 'A custom record being updated in the database.';
5757

5858
// Update their details in the users table using id as the primary key.
59-
$result = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface:class)->updateObject('#__custom_table', $object, 'id');
59+
$result = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class)->updateObject('#__custom_table', $object, 'id');
6060
```
6161

6262
Just like `insertObject`, `updateObject` takes care of escaping table names for us.

0 commit comments

Comments
 (0)