Zend-Framework 1.x with Doctrine 2.x - zend-framework

I know that there are many examples but this is my problem, because now I don't know which is the best and I don't understand every samples. This before I used doctrine 1.x and that was more simple for me, because there was only few steps to connect to database with doctrine and use it:
1.) Created User.yml file into application/doctrine/schema folder
2.) Run generate-models-yaml in cli which generated php classes into application/models/generated folder
3.) Again in cli run: create-db, create-tables
4.) In IndexController / IndexAction I can use it:
$newUser = new User();
$newUser->name = 'Demo';
$newUser->save;
And that's all. But with 2.0 I have some question:
- Where is the best place for mapping yaml files?
- How can I generate Entities from yaml? (Depending from the first answer)
- How can I create/drop db and tables?
- Which solution is the best EntitiyManager?
So I just want the most simple sample like my doctrine 1.x sample. Thanks!

For me best integration Bisna from Guilherme Blanco https://github.com/guilhermeblanco/ZendFramework1-Doctrine2
Step by step video tutorial using Bisna integration
http://www.zendcasts.com/unit-testing-doctrine-2-entities/2011/02/

Another very good example of ZF1 and Doctrine 2 with fully tested code (PHPUnit & Ant):
https://github.com/eddiejaoude/Zend-Framework--Doctrine-ORM--PHPUnit--Ant--Jenkins-CI--TDD-
They try to work best practice. Always.

Here is my two cents, I've wrote a Zend Framework 1.x resource for Doctrine 2.0
The source code is available on github.

This is another sample about zf1 and D2
https://github.com/marsbomber/zf1-doctrine2/tree/modular_setup
I used it and I think it was useful.

Related

Generate PDF in Play Framework Scala

I'm using Play framework 2.2.x and I'm looking for some plugin/lib for generating PDF.
I found this plugin:
https://github.com/joergviola/play20-pdf,
but it's for Java and is not supported already
Do u know some repository with this library? Or some alternatives for Scala and Play Framework?
=== Update
I found some fork, but still no working repository
https://github.com/alias1/play2pdf
Try this one https://github.com/Kaliber/scala-pdf. It is really easy to use, and you can define your own css or even use bootstrap.
This seems to be a very good solution : https://github.com/cloudify/sPDF
Otherwise, I highly recommend http://www.html2pdf.it/
Well javascript can be easy solution . You can use jspdf .

Caching with Entity Framework

has anyone some experience with caching and EF ?
I was looking at the EFProviderWrappers http://code.msdn.microsoft.com/EFProviderWrappers but this project seems to be outdated. Does someone used it with success ?
Or are there other better solution ?
If you want to cache LINQ query results I recommend you try the Pete Montgomery solution. It is applicable in ASP.NET but can be used in desktop apllication if replace HttpRuntime.Cache to System.Runtime.Caching.MemoryCache.Default.
You may try to look at second level caching made by Eye Soft. Here's link to Nuget package and its source code on Codeplex. It's based on EFProviderWrappers, but refactored and seems up to date more or less.

What's the .NET 4.5 equivalent to UserNameWSTrustBinding?

I am converting a active profile STS to the new .NET 4.5 System.IdentityModel framework. My code using the UserNameWSTrustBinding which doesn't seem to exist in the new framework. Any suggestions.
Although this is an old question, I couldn't find any non-third-party answer on the internet, so here it is:
To replace UserNameWSTrustBinding in .NET 4.5, use the following:
var binding = new WS2007HttpBinding(SecurityMode.{what it was before});
binding.Security.Message.ClientCredentialType = MessageCredentialType.UserName;
I ported the WCF bindings to thinktecture identity model:
https://github.com/thinktecture/Thinktecture.IdentityModel.45
I also had a hard time finding something that for .NET 4.5 that was not a third party library. But I came across this link for code you can include in your project.

cachingactivitymapper usage example

We implemented a GWT app using a MVP pattern.
Now we wanted to use cachingactivitymapper in that application.
I searched on the web for how to use this. I couldnt get anything.
Can anyone please provide me the example of using cachingactivitymapper.
Thanks,
Sree
You can easily set up one example via Spring Roo ( if you dont get trippped by spring roo related errors). Reference - http://gwtsts.blogspot.in/2011/03/part-iii-exploring-roo-generated-gwt.html
Some other example GitHub projects -
https://github.com/ashtonthomas/beans
https://github.com/ashtonthomas/gwt-seminar

Zend Framework 2 Db2

I have recently started development on a new application with Zend Framework 2 rc7 but I have been unable to find any reference to a DB2 Adapter.
does anyone know if there are plans to develop one?
So far I have written my own custom DB2 adapter extending many of the Zend Db classes but this is not as full featured as I would like it to be.
Thanks
See if it helps to use the adapter Pdo_Mssql with the option pdoType = dblib (http://fr2.php.net/pdo-dblib)
See http://framework.zend.com/manual/en/zend.db.adapter.html#zend.db.adapter.adapter-notes.pdo-mssql