zikula-modules / Pages

Simple HTML Pages
https://ziku.la/
18 stars 4 forks source link

ContentType is a reserved directory name #21

Closed craigh closed 11 years ago

craigh commented 11 years ago

@phaidon - you have used a 'reserved' directory name in the use of /ContentType as a directory for your Doctrine-handling objects

ContentType is used for objects in use by the Content module

what you are trying to do is better done with EntityRepository classes. Please see PostCalendar or Tag for references.

ghost commented 11 years ago

Something seems vastly wrong about this.... it's an old way of handling things by reserving folders to be scanned. What should happen is there be an API which returns a list of classnames - something like that.

craigh commented 11 years ago

@drak - I do not mean that the folder will be scanned. I only mean that the name is used by Content and that using it in this manner is confusing to future development. Content uses events and listeners to identify plugins as is appropriate, but still the use of ContentType in both situations is incorrect IMO.

craigh commented 11 years ago

@espaan

espaan commented 11 years ago

yes ? Other modules can supply plugins for Content and they are called ContentType, that's how it is. It's also always a matter of Flexbility vs. practicallity. To make this more flexible even as it is now would be overkill to me. It's already an event/listeren system.

For instance the plugin googlemap in Content itself: https://github.com/zikula-modules/Content/blob/master/lib/Content/ContentType/GoogleMap.php it uses the ContentType class name Content_ContentType_GoogleMap extends Content_AbstractContentType, that how it is.

I dont expect Pages to supply plugins for Content, but anyways.

It's just like Entity and Repository you don't expect those classnames to be something other that being Entity / Repository, will be confusing otherwise. Same here I think.

espaan commented 11 years ago

It's a very easy replacement of this class name not resembling the name of another module. Ist only listed 17 times in the whole module. I can make a PR to rename.

The ContentType class seems to be a container/repository for the Enitity Pages. It stores a created page and has some extra methods.

Anybody mind if I make this adjustment ? And what would be the best name for such a collection class ? Repository ?