Skip to content

Commit

Permalink
Убрал слово Catalog из названия класса. Изменил документацию
Browse files Browse the repository at this point in the history
  • Loading branch information
mmjurov committed Jul 21, 2016
1 parent aa61716 commit 7d47507
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 18 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ $hlBlockName = HlBlockTools::findById(2)->name();

```

* CatalogGroupTools: finder for catalog groups (price types) by it's names? id's or "BASE" flag.
* Catalog\GroupTools: finder for catalog groups (price types) by it's names? id's or "BASE" flag.

```php
<?php
use Bex\Tools\Catalog\CatalogGroupTools;
use Bex\Tools\Catalog\GroupTools;

$catalogGroupFinder = CatalogGroupTools::find('RETAIL');
$catalogGroupFinder = GroupTools::find('RETAIL');
$priceTypeId = $catalogGroupFinder->id();

$priceTypeName = CatalogGroupTools::findBase()->name();
$priceTypeName = GroupTools::findBase()->name();

```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* @author Mikhail Zhurov <[email protected]>
*/
class CatalogGroupFinder extends Finder
class GroupFinder extends Finder
{
protected static $cacheDir = 'bex_tools/catalog_groups';
protected static $cacheTag = 'bex_catalog_groups';
Expand Down
17 changes: 7 additions & 10 deletions src/Catalog/CatalogGroupTools.php → src/Catalog/GroupTools.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
* @author Mikhail Zhurov <[email protected]>
*/
class CatalogGroupTools
class GroupTools
{
/**
* Gets Finder for catalog groups by group name.
Expand All @@ -20,11 +20,11 @@ class CatalogGroupTools
* @param bool $silenceMode When you use silence mode instead of an exception \Bex\Tools\ValueNotFoundException
* (if value was be not found) is returned null.
*
* @return CatalogGroupFinder
* @return GroupFinder
*/
public static function find($name, $silenceMode = false)
{
return new CatalogGroupFinder(
return new GroupFinder(
['name' => $name],
$silenceMode
);
Expand All @@ -36,13 +36,11 @@ public static function find($name, $silenceMode = false)
* @param int $id Group ID
* @param bool $silenceMode When you use silence mode instead of an exception \Bex\Tools\ValueNotFoundException
* (if value was be not found) is returned null.
* @return CatalogGroupFinder
* @return GroupFinder
*/
public static function findById($id, $silenceMode = false)
{
return new CatalogGroupFinder(
['id' => $id],
return new GroupFinder(['id' => $id],
$silenceMode
);
}
Expand All @@ -53,12 +51,11 @@ public static function findById($id, $silenceMode = false)
* @param bool $silenceMode When you use silence mode instead of an exception \Bex\Tools\ValueNotFoundException
* (if value was be not found) is returned null.
*
* @return CatalogGroupFinder
* @return GroupFinder
*/
public static function findBase($silenceMode = false)
{
return new CatalogGroupFinder(
['base' => true],
return new GroupFinder(['base' => true],
$silenceMode
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ class Loader
['highloadblock', '\Bitrix\Highloadblock\HighloadBlock::OnAfterUpdate', ['\Bex\Tools\HlBlock\HlBlockFinder', 'onAfterSomething']],
['highloadblock', '\Bitrix\Highloadblock\HighloadBlock::OnAfterDelete', ['\Bex\Tools\HlBlock\HlBlockFinder', 'onAfterSomething']],

['catalog', 'OnGroupAdd', ['\Bex\Tools\CatalogGroup\CatalogGroupFinder', 'onGroupAdd']],
['catalog', 'OnGroupUpdate', ['\Bex\Tools\CatalogGroup\CatalogGroupFinder', 'onGroupUpdate']],
['catalog', 'OnGroupDelete', ['\Bex\Tools\CatalogGroup\CatalogGroupFinder', 'onGroupDelete']]
['catalog', 'OnGroupAdd', ['\Bex\Tools\CatalogGroup\GroupFinder', 'onGroupAdd']],
['catalog', 'OnGroupUpdate', ['\Bex\Tools\CatalogGroup\GroupFinder', 'onGroupUpdate']],
['catalog', 'OnGroupDelete', ['\Bex\Tools\CatalogGroup\GroupFinder', 'onGroupDelete']]
];

/**
Expand Down

0 comments on commit 7d47507

Please sign in to comment.