Skip to content

Instantly share code, notes, and snippets.

View develop7's full-sized avatar

Andrei Dziahel develop7

View GitHub Profile
<?php
# FROZEN_SF_LIB_DIR: /usr/share/php/symfony
require_once dirname(__FILE__).'/../lib/symfony/autoload/sfCoreAutoload.class.php';
sfCoreAutoload::register();
class ProjectConfiguration extends sfProjectConfiguration
{
public function setup()
Post:
actAs:
Timestampable: ~
columns:
content: text
relations:
Comments:
class: Comment
local: id
foreign: post_id
# default values
all:
.nodes:
node_root:
node1: 1
node2: 2
node3: [1,2,3,4]
<?php
//...snip
$q = Doctrine_Query::create()->from('Post p, p.Comments c')->select('p.*, c.*, COUNT(c.id) AS comment_count')->having('comment_count <= p.max_comments');
$q->getSql(); //produces '... HAVING a2__0 <= p.max_comments ...'
//instead of '... HAVING a2__0 <= a__max_comments ...'
Post:
actAs:
Bookmarkable:
owner: User
#...
User:
columns:
username: string(10)
BlackListPhone:
phone_1:
code: 123
phone: 111
Contents: [content_1]
phone_2:
code: 123
phone: 222
phone_3:
code: 123
<?php
class Model extends BaseModel
{
public function getPrice($format = null)
{
return is_null($format)?$this->_get('price'):sprintf($format, $this->_get('price'));
}
}
Match:
columns:
#...skip
relations:
Participants:
local: match_id
foreign: player_id
refClass: MatchPlayer
foreignAlias: MatchesPlayed
all:
features:
- extensibility
- robustness
- vibrancy
void testDefaultConstruction()
{
Foo foo = new Foo();
assertNotNull(foo);
}