propel

Is there a good comparison of Doctrine vs Propel?

谁说我不能喝 提交于 2019-12-05 07:51:00
I've seen plenty of comparisons of Doctrine vs Propel, but none of them has actually convinced me to choose Doctrine over Propel. I've been using Propel for a while now and almost every comparison I read states that Propel is not well documented as the first problem and I've read Propel's docs and they're quite well. Also, most of comparisons are dated, (using Propel 1.5+). Does anyone knows of a highly convincing post in a blog where I can see test results and some actual differences? I suspect you were around when I asked my question yesterday on freenode? Most of the time, it's not

Twig instanceof for inheritance objects

自作多情 提交于 2019-12-04 22:40:22
I am using the following feature from propel http://www.propelorm.org/documentation/09-inheritance.html . I am also using Symfony2 and Twig I have a class structure using the above feature that looks something like this class Event {} class Birthday extends Event {} class Walking extends Event {} now I pass an event object to a twig template and I want to know what type of event it is For instance I want to display an image of a cake if its a birthday and I want to display map routes if its walking event. I cannot use instanceof in Twig as this feature does not exist. Does anyone now why this

Secure Propel connection, remote MySQL

我们两清 提交于 2019-12-04 21:57:17
Is it possible to configure Propel to use SSL connection with remote MySQL server? I found the same question with Doctrine, but it isn't answered either: How to connect to MySQL using SSL on symfony/doctrine You can use the connection options to set PDO SSL attributes . Here's an example for the runtime config file: $serviceContainer = Propel::getServiceContainer(); $serviceContainer->setAdapterClass($db_name, 'mysql'); $manager = new ConnectionManagerSingle(); $manager->setConfiguration(array( 'dsn' => 'mysql:host=' . $db_host . ';dbname=' . $db_name, 'user' => $db_username, 'password' => $db

How to Zend Framework with Propel ORM

断了今生、忘了曾经 提交于 2019-12-04 19:23:19
问题 I'd like to integrate Propel with Zend framework . I've seen the integration of doctrine in the past but this post says it seems propel is done a bit differently. Propel has two things going for it already: the first is that Propel includes its own autoloader, meaning that I didn't have to try and force Propel into Zend Framework ’s file system structure. The second is that Propel is designed to let you put it’s files anywhere you want with ease, so long as you update your include path

Propel Single Table Inheritance Issue

守給你的承諾、 提交于 2019-12-04 17:04:18
I have a table called "talk", which is defined as abstract in my schema.xml file. It generates 4 objects (1 per classkey): Comment, Rating, Review, Checkin It also generates TalkPeer, but I couldn't get it to generate the other 4 peers (CommentPeer, RatingPeer, ReviewPeer, CheckinPeer), so I created them by hand, and made them inherit from TalkPeer.php, which inherits from BaseTalkPeer. I then implemented getOMClass() in each of those peers. The problem is that when I do queries using the 4 peers, they return all 4 types of objects. That is, ReviewPeer will return Visits, Ratings, Comments,

Adding custom columns to Propel model?

余生长醉 提交于 2019-12-04 13:05:52
At the moment I am using the below query: $claims = ClaimQuery::create('c') ->leftJoinUser() ->withColumn('CONCAT(User.Firstname, " ", User.Lastname)', 'name') ->withColumn('User.Email', 'email') ->filterByArray($conditions) ->paginate($page = $page, $maxPerPage = $top); However I then want to add columns manually, so I thought this would simply work: foreach($claims as &$claim){ $claim->actions = array('edit' => array( 'url' => $this->get('router')->generate('hera_claims_edit'), 'text' => 'Edit' ) ); } return array('claims' => $claims, 'count' => count($claims)); However when the data is

Propel case-sensitive phpNames for columns

会有一股神秘感。 提交于 2019-12-04 13:02:09
The relevant portion of my schema.xml : <database name="Inventory" defaultIdMethod="native"> <table name="Users" phpName="User"> <column name="UserId" type="varchar" size="20" required="true" primaryKey="true" /> <column name="FirstName" type="varchar" size="255" required="true" /> <column name="LastName" type="varchar" size="255" required="true" /> <column name="Password" type="varchar" size="255" required="true" /> <column name="Salt" type="char" size="22" required="true" /> <column name="RoleId" type="integer" required="true" /> <column name="FailedLogins" type="integer" required="true"

Propel: selecting columns from aliased join tables

偶尔善良 提交于 2019-12-04 12:32:09
I have the following two tables: table_a: id_table_a: { type: integer, primaryKey: true, autoIncrement: true, required: true } name: { type: varchar(255) } id_table_b: { type: integer, foreignTable: table_b, foreignReference: id_table_b } table_b: id_table_b: { type: integer, primaryKey: true, autoIncrement: true, required: true } value_1: { type: varchar(255) } value_2: { type: integer } and I would like to build SQL query using select method to skip hydration, also using aliases on joined tables: TableAQuery::create() ->useTableBQuery('a') // some filters methods ->endUse() ->useTableBQuery(

Performing Join with Multiple Criteria in Propel 1.5

主宰稳场 提交于 2019-12-04 12:21:49
This question follows on from the questions here and here . I have recently upgraded to Propel 1.5, and have started using it's Query features over Criteria. I have a query I cannot translate, however - a left join with multiple criteria: SELECT * FROM person LEFT JOIN group_membership ON person.id = group_membership.person_id AND group_id = 1 WHERE group_membership.person_id is null; Its aim is to find all people not in the specified group. Previously I was using the following code to accomplish this: $criteria->addJoin(array( self::ID, GroupMembershipPeer::GROUP_ID, ), array(

Procedures of Oracle in php with PDO

只谈情不闲聊 提交于 2019-12-04 04:16:39
问题 I'm having a problem with propel 1.6 and a oracle procedure. I post it under PDO because I'm Propel just for proxying my call to PDO. Basically the procedure get the user name and password, checks that is OK and return the user. For that reason it returns an types.cursorType. The sql start like this. CREATE OR REPLACE PROCEDURE "SP_LOGIN" (R_CURSOR OUT types.cursorType, UserId IN VARCHAR2, Password IN VARCHAR2) my php code is: $con = Propel::getConnection(); $sql = 'BEGIN SP_LOGIN(:CURSOR, :0