Skip to content

Commit

Permalink
Remove TableRegistry mentions and examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Pustułka authored and robertpustulka committed Sep 21, 2017
1 parent 21bb17d commit 587daff
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/ORM/README.md
Expand Up @@ -58,9 +58,9 @@ complete examples.
Once you've defined some table classes you can read existing data in your tables:

```php
use Cake\ORM\TableRegistry;
use Cake\ORM\Locator\LocatorAwareTrait;

$articles = TableRegistry::get('Articles');
$articles = $this->getTableLocator()->get('Articles');
foreach ($articles->find() as $article) {
echo $article->title;
}
Expand All @@ -76,7 +76,7 @@ Table objects provide ways to convert request data into entities, and then persi
those entities to the database:

```php
use Cake\ORM\TableRegistry;
use Cake\ORM\Locator\LocatorAwareTrait;

$data = [
'title' => 'My first article',
Expand All @@ -91,7 +91,7 @@ $data = [
]
];

$articles = TableRegistry::get('Articles');
$articles = $this->getTableLocator()->get('Articles');
$article = $articles->newEntity($data, [
'associated' => ['Tags', 'Comments']
]);
Expand All @@ -109,7 +109,7 @@ for more in-depth examples.
Once you have a reference to an entity, you can use it to delete data:

```php
$articles = TableRegistry::get('Articles');
$articles = $this->getTableLocator()->get('Articles');
$article = $articles->get(2);
$articles->delete($article);
```
Expand Down
4 changes: 2 additions & 2 deletions src/ORM/Table.php
Expand Up @@ -297,10 +297,10 @@ public function __construct(array $config = [])
* Get the default connection name.
*
* This method is used to get the fallback connection name if an
* instance is created through the TableRegistry without a connection.
* instance is created through the TableLocator without a connection.
*
* @return string
* @see \Cake\ORM\TableRegistry::get()
* @see \Cake\ORM\Locator\TableLocator::get()
*/
public static function defaultConnectionName()
{
Expand Down
2 changes: 1 addition & 1 deletion src/View/Form/EntityContext.php
Expand Up @@ -112,7 +112,7 @@ public function __construct(ServerRequest $request, array $context)
* Prepare some additional data from the context.
*
* If the table option was provided to the constructor and it
* was a string, ORM\TableRegistry will be used to get the correct table instance.
* was a string, TableLocator will be used to get the correct table instance.
*
* If an object is provided as the table option, it will be used as is.
*
Expand Down

0 comments on commit 587daff

Please sign in to comment.