Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Hotfix for compatibility between PetrP's ORM v0.4.0 and Nette v2.3.0-RC2
diff --git a/vendor/petrp/orm/Repository/Helpers/RepositoryHelper.php b/vendor/petrp/orm/Repository/Helpers/RepositoryHelper.php
index fb2d8f9..4c89622 100644
--- a/vendor/petrp/orm/Repository/Helpers/RepositoryHelper.php
+++ b/vendor/petrp/orm/Repository/Helpers/RepositoryHelper.php
@@ -30,8 +30,8 @@ class RepositoryHelper extends Object
$repositoryClass = get_class($repository);
if (!isset($this->normalizeRepositoryCache[$repositoryClass]))
{
- $name = strtolower($repositoryClass);
- if (substr($name, -10) === 'repository')
+ $name = $repositoryClass;
+ if (substr($name, -10) === 'Repository')
{
$name = substr($name, 0, strlen($name) - 10);
}
diff --git a/vendor/petrp/orm/RepositoryContainer/RepositoryContainer.php b/vendor/petrp/orm/RepositoryContainer/RepositoryContainer.php
index 55c3e84..e0773d2 100644
--- a/vendor/petrp/orm/RepositoryContainer/RepositoryContainer.php
+++ b/vendor/petrp/orm/RepositoryContainer/RepositoryContainer.php
@@ -127,7 +127,7 @@ class RepositoryContainer extends Object implements IRepositoryContainer
*/
public function getRepository($name)
{
- $name = strtolower($name);
+// $name = strtolower($name);
if (isset($this->aliases[$name]))
{
$class = $this->aliases[$name];
@@ -164,7 +164,7 @@ class RepositoryContainer extends Object implements IRepositoryContainer
public function register($alias, $repositoryClass)
{
$this->checkRepositoryClass($repositoryClass, $repositoryClass, true, $originClass);
- $alias = strtolower($alias);
+// $alias = strtolower($alias);
if ($this->isRepository($alias, false))
{
throw new RepositoryAlreadyRegisteredException("Repository alias '{$alias}' is already registered");
@@ -180,7 +180,7 @@ class RepositoryContainer extends Object implements IRepositoryContainer
*/
final public function isRepository($name)
{
- $name = strtolower($name);
+// $name = strtolower($name);
if (isset($this->aliases[$name])) return true;
if ($this->checkRepositoryClass($name, $name, false, $originClass))
{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.