Tag Archives: symfony

Tip: Working with BLOB column

This article has moved to this location.

Let’s say we have the following XML Schema:

<table name="product_image">
  <column name="id" type="integer" required="true" primaryKey="true" autoIncrement="true" />
  <column name="name" type="varchar" required="true" size="255" />
  <column name="filename" type="blob" required="true" />
  <column name="description" type="longvarchar" required="true" />
  <column name="extension" type="varchar" size="5" required="true" />

How to read and write blob type using Propel?
Read More

sfAdminAjaxThemePlugin now in symfony plugin repository

This article has moved to this location.

In my previous article, i’ve shown you how to ajaxify symfony admin generator, and now it has been packaged as a plugin and is available to download. This plugin still in an alpha state, and it use propel (sfPropelPlugin or sfPropel15Plugin) as an ORM. So i welcome your feedback.


Here are some screenshots:

Screenshot when an item was deleted successfully

Screenshot when an item was deleted successfully

Read More

Ajaxify Symfony Admin Generator

This article has moved to this location.

Symfony admin generator is a great tool to simplify writing web interfaces. By simply typing php symfony propel:generate-admin backend Product you have an administration interface which a lot of features. You can filter, sort, paginate, create and edit an object without writing a single lines of code. All the features above can be customized through generator.yml. There are a variety of customizations available and you can read about those here.

In this article, i would like to show how to ajaxify symfony admin generator using jQuery.
Read More

sfPropelCustomSelectPlugin sample usage

This article has moved to this location.

A few days ago, i’ve made sfPropelCustomSelectPlugin, a plugin that allow to select arbitrary columns without loosing the power of Propel ORM. In this article, i would like to show you how to use the plugin in your application. This plugin was designed to work well with doSelect, doSelectJoinXXX functions and sfPropelPager class. If you are using propel 1.5 you can using ModelCriteria::select() and ModelCriteria::withColumn() together to achieve the same result (http://www.propelorm.org/ticket/1172).
I assume that you have already installed the plugin correctly.
Read More

Selecting arbitrary┬ácolumns using propel

Generally we cannot use hydrate() with a query where we specify our own select columns. Propel always assumes that statements passed to hydrate() contain the full properties for the object. But of course we can still get the object(s) by populating the statements manually.

while ($row = $stmt->fetch (PDO::FETCH_NUM))
   $myClass = new myClass();
   $myClasses[] = $myClass;
return $myClasses;

But the problem will arise when we are working with sfPropelPager, because sfPropelPager only works with Object.
So, how to return the propel object(s) when we want to select only a few columns?. In this article, i would like to share my idea how to solve the problem stated above.
Read More