Hello Marco,

BjyAuthorize provides entities "User.php.dist" and  "Role.php.dist" in the
folder "vendor\bjyoungblood\bjy-authorize\data".

They don't simply extend
"vendor\zf-commons\zfc-user\src\ZfcUser\Entity\User.php" as you do in
"vendor\zf-commons\zfc-user-doctrine-orm\src\ZfcUserDoctrineORM\Entity\User.php".
They use a new class.

The Entity "vendor\bjyoungblood\bjy-authorize\data\User.php.dist" has a code
snippet:
...

/**
* An example of how to implement a role aware user entity.
*
* @ORM\Entity
* @ORM\Table(name="users") <-------------------- NOTICE - plural
*
* @author Tom Oram <[email protected]>
*/
class User implements UserInterface, ProviderInterface

...

If we use "User.php" entity from "BjyAuthorize" and run
 "vendor\bin\doctrine.bat orm:schema-tool:create",

We end up having a table called "users" - plural.

If you follow "ZfcUser" installation you will have a table "user" - singular.

In the module "SamUser <<https://github.com/manuakasam/SamUser> > " and the
famous
tutorial "ZfcUser, BjyAuthorize and Doctrine working together
<<http://samminds.com/2013/03/zfcuser-bjyauthorize-and-doctrine-working-together/>
>
" Sam is using the mentioned above "User.php.dist" from "BjyAuthorize".

So we end up having 3 tables:

* role - singular
* users - plural
* users_roles
We are not consistent!
I know the Doctrine idea "Simply said: Forget about the database!" :) I love it!
But in the case of modules we can not completely forget the database.
Some people may not use Doctrine in the modules.
If we want to build a repository of reusable compatible modules we need
  Database, Table and Column Naming Conventions.


 Best Regards,

Stoyan Cheresharov



> Marco Pivetta <[email protected]> hat am 12. Juli 2013 um 00:08 geschrieben:
> 
>  Heya!
> 
>  Just to make it clear, BjyAuthorize doesn't provide any standard table names
> by default... All configs are opt-in.
> 
>  Yes, modules may become incompatible if they are not configurable, but that's
> up to the developers to sort out.
> 
>  Marco Pivetta
> 
>  <http://twitter.com/Ocramius>
> 
> 
>  <http://ocramius.github.com/>
> 
> 
>  On 11 July 2013 18:15, [email protected]
> <mailto:[email protected]> <[email protected]
> <mailto:[email protected]> > wrote:
>    > > Hello guys,
> > 
> >    Is there Database, Table and Column Naming Conventions for ZF2 modules?
> >    As a proof of a concept we try to build a simple system using only the
> > available
> >    ZF2 modules from <<http://modules.zendframework.com/> > .
> >    This is my composer.json:
> > 
> >    {
> >    "name": "zendframework/skeleton-application",
> >    "description": "Skeleton Application for ZF2",
> >    "license": "BSD-3-Clause",
> >    "keywords": [
> >    "framework",
> >    "zf2"
> >    ],
> >    "homepage": "<http://framework.zend.com/> ",
> >    "minimum-stability": "alpha",
> >    "require": {
> >    "php": ">=5.3.3",
> >    "zendframework/zendframework": ">2.2.0rc1",
> >    "doctrine/doctrine-orm-module": "0.7.*",
> >    "zf-commons/zfc-user": "0.1.*",
> >    "zf-commons/zfc-user-doctrine-orm": "0.1.*",
> >    "bjyoungblood/bjy-authorize": "1.2.*",
> >    "manuakasam/sam-user": "dev-master",
> >    "cdli/CdliTwoStageSignup": "dev-master"
> >    }
> >    }
> > 
> >    We are planning to add a CMS as well:
> > 
> >    - <<http://www.ejoom.com/libra-zend-framework-2-cms> >
> > 
> >    - <<http://got-cms.com/> >
> > 
> >    What we try to achieve is to build a simple system like one build with
> >    WordPress. I should be able to log in as administrator and manage posts.
> > 
> >    But different modules use different table names for the same Entities.
> > 
> >    ZfcUser -> table name "user" - singular
> > 
> >    BjyAuthorize -> for the same table "users" - plural
> > 
> >    For the names of the fields we have similar problem.
> > 
> >    At one point the modules will not be compatible.
> > 
> >    I think we will need some kind of  Database, Table and Column Naming
> > Conventions
> >    for ZF2 modules.
> > 
> >    Is this the appropriate place to raise this question?
> > 
> > 
> > 
> >    Best Regards
> > 
> >    Stoyan Cheresharov
> > 
> >  > 

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]

Reply via email to