TYPO3 with doctrine - usage of DQL? - typo3

since doctrine is implemented now, is it possible to use DQL in Repository?
And if, how is the naming of models?
Symfony implemented Models in DQL like Bundle:Model, but DQL supports namespaced Models like Vendor\Plugin\Domain\Model\XY
But i do not see functions like setParameters, setMaxResults.

No, this is not possible. TYPO3 only implements Doctrine DBAL, but not Doctrine ORM.
However you can use the TYPO3 query builder with the statement() method. The mapping will be done as usual in extbase.
Another option is to use the extension doctrine_orm. See the manual for information about the integration and limitations:
https://github.com/cyberhouse/typo3-doctrine-orm/blob/master/Documentation/Integrations.rst

Related

Does Doctrine 2.5 has an alternative to JPA #ElementCollection?

Doctrine 2.5 has embedded objects feature, but what I am looking is a collection of these objects like Java Persistence API has. Basically, an annotation #ElementCollection is what I am looking for doctrine.
Looks like Doctrine had such functionality developed in 2.2 version, but is it left over or what?
Doctrine 2.5 does not support multiple embedded objects yet.
But you have following alternative solutions :
Serialising a collection of embedded objects into a single column
Map them as entity and one-to-many relationship but use OO to enforce the embedded object 's characteristic.For example , to well encapsulate them such that its lifecycle and behaviour can only be managed by its parent.
Reference:
Domain-Driven Design in PHP - Persisting a Collection of Value Objects
Persisting Value Objects in Doctrine

C# Catel Framework & Entity Framework & Unity of Work

i want use the Entity Framework with Catel to use the UoW pattern in my code. I have reade this article:
http://www.geertvanhorrik.com/category/catel/page/2/
I create a new Project with the name "Database". In this project i implement my Application Models. At the moment i store the data in a XML file but i want store it in a SQL Database in the future. My models a derived from "SaveableModelBase".
public class SettingsDataObject : SavableModelBase
1) What must i do to use the Entityframework? Is there a EntityModelBase or something?
2) How i must design my model classes?
2) How i register the Repositories with the ServiceLocator? RegisterType< ..., ...>?
3) Can i use the "Code First" and AutoGenerate Database Tables in Catel?
Where i can find a good basic code Example to implement the UoW pattern with Catel?
What must i do to implement a UoW with Catel?
I hope anybody can help me,
Thank you & Greetings
Catel does not provide base classes for Entity Framework. EF is normally used in combination with SQL server databases. It cannot be used in combination with the SavableModelBase.
For more information, see the official documentation:
https://catelproject.atlassian.net/wiki/display/CTL/Catel.Extensions.EntityFramework5

Yii Gii with MongoDB

Could anyone please tell me how MongoDB can be used with YII?
How can we create controller and model functions using Gii if the database used is MongoDB?
I've used YiiMongoDBSuite (YMDS), which has some very rough support for Gii. You can generate starter classes, but given that MongoDB does not have a fixed schema you will need to edit the model to make them useful. There is an odd kludge that lets you generate MongoDB models from a SQL table, but this seems more effort than it's worth.
YMDS' EMongoDocument class extends the standard Yii CModel class, so this is a useful base if you want to build apps with CRUDS.
The unfortunate caveat is that YMDS is no longer maintained by the original author, and there are a few community forks to chose between.
The way of creating controllers is same as usual but you have to use an extension to talk to mongoDB from Yii ,
You need to use direct Mongo suite of yii . It is an extension which has a collection of components for the mongoDB .

how does one describe/impolements contraints and tables relations in Zend_DB 2.0 (zf2 beta5) mappers classes

In zend_db 1.x we used reference_map to implements constaints and relations in the data mapper classes. In zend_db 2.0 where should the reference map go?
There is no referencing possible in ZF 2.0
You can see from my previous question that in ZF 2 you'll be either using a full blown ORM like Doctrine 2 or Propel for these kind of purposes or to write your own SQL Queries. The Zend DB Component is seen as a lightweight abstraction to handle simple task related stuff.

Best Practices - Data Annotations vs OnChanging in Entity Framework 4

I was wondering what the general recommendation is for Entity Framework in terms of data validation. I am relatively new to EF, but it appears there are two main approaches to data validation.
The first is to create a partial class for the model, and then perform data validations and update a collection of rule violations. This is outlined at http://msdn.microsoft.com/en-us/library/cc716747.aspx
The other is to use data annotations and then have the annotations perform data validation. Scott Guthrie explains this on his blog at http://weblogs.asp.net/scottgu/archive/2010/01/15/asp-net-mvc-2-model-validation.aspx.
I was wondering what the benefits are of one over the other. It seems the data annotations would be the preferred mechanism, especially as you move to RIA Services, but I want to ensure I am not missing something. Of course, nothing precludes using both of them together.
Thanks
John
I have been using DataAnnotations using MVC 2 and it works great. I have not tried the partial on an entity object for validation, but I see its uses. Basically if I create a partial class on an entity object I use it to default data such as a GUID identifier. or Create Date or modified Date. I guess it would be useful to add validations in the partial class perhaps for some complex validation that needs to happen in the entity layer but even then those validations could be accomplished in custom validator. If you are using an MVC website then I would personally use dataannotations.