Yii Framework Forum: Using Propel - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Using Propel Rate Topic: -----

#1 User is offline   kenci 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 15
  • Joined: 08-October 08

Posted 16 October 2008 - 07:36 AM

Why not use Propel as DB-Framework? It is very powerful and easy to use.

Some examples:

Simple insert:
<?php
/* initialize Propel, etc. */

$author = new Author();
$author->setFirstName("Jack");
$author->setLastName("London");
$author->save();


Simple Criteria:
<?php

$c = new Criteria();
$c->add(AuthorPeer::FIRST_NAME, "Karl");
$c->add(AuthorPeer::LAST_NAME, "Marx", Criteria::NOT_EQUAL);

$authors = AuthorPeer::doSelect($c);
// $authors contains array of Author objects


In version 1.3 they are switching from Creole to PDO which is much more faster. I use Propel 1.2 in my Prado3 project and it was easy to implement.
0

#2 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,875
  • Joined: 04-October 08
  • Location:DC, USA

Posted 16 October 2008 - 07:56 AM

Yii's ActiveRecord is also very powerful. To accomplish the same task, you can use Yii AR as follows,

$author=new Author;
$author->firstName='Jack';
$author->lastName='London';
$author->save();


There are also very powerful support for queries in Yii AR.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users