Skip to content

Instantly share code, notes, and snippets.

DebateCategory:
columns:
id:
primary: true
type: integer
autoincrement: true
debate_category_id: integer
section_id: integer
title: string(255)
content: string(1000)
<?php
//THE CLASS
class AccountImageForm extends sfForm
{
public function configure()
{
$this->widgetSchema['image'] = new sfWidgetFormInputFile();
$this->validatorSchema['image'] = new sfValidatorFile(array(
'path' => sfConfig::get('app_upload_dir') . '/users',
'required' => true,
<?php
class ArticleContributeForm extends ArticleForm
{
public function configure()
{
parent::configure();
unset($this['article_draft_category_id']);
$this->embedForm('source', new ArticleSourceForm($this->object->ArticleSources[0]));
function array_compare($array1, $array2) {
$diff = false;
// Left-to-right
foreach ($array1 as $key => $value) {
if (!array_key_exists($key,$array2)) {
$diff[0][$key] = $value;
} elseif (is_array($value)) {
if (!is_array($array2[$key])) {
$diff[0][$key] = $value;
$diff[1][$key] = $array2[$key];
<?php
/**
*/
class CommentTable extends Doctrine_Table
{
public function getByObject($object)
{
$tree = $this->createQuery('c')
->from('Comment c')
<?php
/**
*/
class PluginCommentTable extends Doctrine_Table
{
public function findTreeByModelAndModelId($model, $model_id, Doctrine_Query $query = null, $hydration = null)
{
//if $query is null create a query
$query = $query ? $query : $this->createQuery('c');
<?php
class sfRpx
{
private
$methods = array(
'auth_info',
);
protected
<?php
class sfRpx
{
private
$methods = array(
'auth_info',
);
protected
<?php
class sfRpx
{
private
$methods = array(
'auth_info',
);
protected
$.fn.ac = function (options) {
options = $.extend({}, $.fn.ac.defaults, options);
var element = $(this);
var index = -1;
//Generate the lists that will be used for ac
var ul = $('<ul />').css({ display: 'none'}).insertAfter(this);
ul.attr('id', 'ac_' + $.data(this));
//when the focus is lost of the input hide the ac list. 200ms so if we click the list it