Hi all,
I was using Cakephp orm as a standalone tool.
One thing that I need to do was configure the App.namespace .
Configure::write('App.namespace', 'App');
Recently I came across something. I need to build a package, and the namespace of the package is different.
Say Hkt\Blog . Now I could read it if I have put the App.namespace to Hkt .
But if I kept the App.namespace to App for my default application it will load the base Entity and base Table class . By base I mean (Cake\ORM\Entity , Cake\ORM\Table ) .
Application
src/App/Model/Table/UsersTable.php
src/App/Model/Entity/User.php
Library
vendor/hkt/blog/src/Model/Table/PostsTable.php
vendor/hkt/blog/src/Model/Entity/Post.php
TableRegistry::get('Users') => Need to load App/Model/Table/UsersTable
TableRegistry::get('Posts') => Need to load Hkt/Blog/Model/Table/PostsTable , currently this loads Cake\ORM\Table .
Is there is a way to achieve what I am trying to do so I can have many vendor libraries that work with Cake orm can be installed. I know there may be something I missed or can do for it works for plugins in cakephp framework.
Thank you
Hari KT
-- I was using Cakephp orm as a standalone tool.
One thing that I need to do was configure the App.namespace .
Configure::write('App.namespace', 'App');
Recently I came across something. I need to build a package, and the namespace of the package is different.
Say Hkt\Blog . Now I could read it if I have put the App.namespace to Hkt .
But if I kept the App.namespace to App for my default application it will load the base Entity and base Table class . By base I mean (Cake\ORM\Entity , Cake\ORM\Table ) .
Application
src/App/Model/Table/UsersTable.php
src/App/Model/Entity/User.php
Library
vendor/hkt/blog/src/Model/Table/PostsTable.php
vendor/hkt/blog/src/Model/Entity/Post.php
TableRegistry::get('Users') => Need to load App/Model/Table/UsersTable
TableRegistry::get('Posts') => Need to load Hkt/Blog/Model/Table/PostsTable , currently this loads Cake\ORM\Table .
Is there is a way to achieve what I am trying to do so I can have many vendor libraries that work with Cake orm can be installed. I know there may be something I missed or can do for it works for plugins in cakephp framework.
Thank you
Hari KT
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment