Skip to content

Commit

Permalink
Removed trailing whitespace, unwanted tabs/spaces and so on...
Browse files Browse the repository at this point in the history
Now, we will take care of that as well as file permissions.
  • Loading branch information
willdurand committed Aug 11, 2011
1 parent 68f1695 commit aaff75d
Show file tree
Hide file tree
Showing 360 changed files with 6,561 additions and 6,565 deletions.
22 changes: 11 additions & 11 deletions WHATS_NEW
Expand Up @@ -70,7 +70,7 @@ $page = new WikiPage();
// automatic version increment
$page->setTitle('Propel');
$page->setBody('Propel is a CRM built in PHP');
$page->save();
$page->save();
echo $page->getVersion(); // 1
$page->setBody('Propel is an ORM built in PHP5');
$page->save();
Expand Down Expand Up @@ -338,7 +338,7 @@ echo $authors;
}}}

If you want to use another format for the default string representation instead of YAML, you can set the `defaultStringFormat` attribute to any of the supported formats in either the `<database>` or the `<table>` elements in the XML schema:

{{{
#!xml
<table name="publisher" defaultStringFormat="XML">
Expand Down Expand Up @@ -543,7 +543,7 @@ To enable a model-only relationship, add a `<foreign-key>` tag using the `skipSq
</table>
}}}

Such a foreign key is not translated into SQL when Propel builds the table creation or table migration code. It can be seen as a "virtual foreign key". However, on the PHP side, the `Book` model actually has a one-to-many relationship with the `Review` model. The generated !ActiveRecord and !ActiveQuery classes take advantage of this relationship to offer smart getters and filters.
Such a foreign key is not translated into SQL when Propel builds the table creation or table migration code. It can be seen as a "virtual foreign key". However, on the PHP side, the `Book` model actually has a one-to-many relationship with the `Review` model. The generated !ActiveRecord and !ActiveQuery classes take advantage of this relationship to offer smart getters and filters.

== Advanced Column Types ==

Expand Down Expand Up @@ -595,13 +595,13 @@ An `OBJECT` column can store PHP objects (mostly Value Objects) in the database.
class GeographicCoordinates
{
public $latitude, $longitude;

public function __construct($latitude, $longitude)
{
$this->latitude = $latitude;
$this->longitude = $longitude;
}

public function isInNorthernHemisphere()
{
return $this->latitude > 0;
Expand Down Expand Up @@ -685,21 +685,21 @@ SQL supports table subqueries to solve complex cases that a single query can't s

{{{
#!sql
SELECT book.ID, book.TITLE, book.AUTHOR_ID, book.PRICE, book.CREATED_AT, MAX(book.CREATED_AT)
FROM book
SELECT book.ID, book.TITLE, book.AUTHOR_ID, book.PRICE, book.CREATED_AT, MAX(book.CREATED_AT)
FROM book
GROUP BY book.AUTHOR_ID
}}}

Now if you want only the cheapest latest books with a single query, you need a subquery:
{{{
#!sql
SELECT lastBook.ID, lastBook.TITLE, lastBook.AUTHOR_ID, lastBook.PRICE, lastBook.CREATED_AT
SELECT lastBook.ID, lastBook.TITLE, lastBook.AUTHOR_ID, lastBook.PRICE, lastBook.CREATED_AT
FROM
(
SELECT book.ID, book.TITLE, book.AUTHOR_ID, book.PRICE, book.CREATED_AT, MAX(book.CREATED_AT)
FROM book
SELECT book.ID, book.TITLE, book.AUTHOR_ID, book.PRICE, book.CREATED_AT, MAX(book.CREATED_AT)
FROM book
GROUP BY book.AUTHOR_ID
) AS lastBook
) AS lastBook
WHERE lastBook.PRICE < 20
}}}

Expand Down
12 changes: 6 additions & 6 deletions docs/behavior/alternative_coding_standards.txt
Expand Up @@ -24,7 +24,7 @@ Rebuild your model, and you're ready to go. The code of the model classes now us
// in om/BaseBook.php
/**
* Set the value of [title] column.
*
*
* @param string $v new value
* @return Table4 The current object (for fluent API support)
*/
Expand All @@ -34,21 +34,21 @@ Rebuild your model, and you're ready to go. The code of the model classes now us
{
$v = (string) $v;
}

if ($this->title !== $v)
{
$this->title = $v;
$this->modifiedColumns[] = BookPeer::TITLE;
}

return $this;
}
// instead of

// instead of

/**
* Set the value of [title] column.
*
*
* @param string $v new value
* @return Table4 The current object (for fluent API support)
*/
Expand Down
2 changes: 1 addition & 1 deletion docs/behavior/i18n.txt
Expand Up @@ -166,7 +166,7 @@ $items = ItemQuery::create()

== Symfony Compatibility ==

This behavior is entirely compatible with the i18n behavior for symfony. That means that it can generate `setCulture()` and `getCulture()` methods as aliases to `setLocale()` and `getLocale()`, provided that you add a `locale_alias` parameter. That also means that if you add the behavior to a table without translated columns, and that the translation table is present in the schema, the behavior recognizes them.
This behavior is entirely compatible with the i18n behavior for symfony. That means that it can generate `setCulture()` and `getCulture()` methods as aliases to `setLocale()` and `getLocale()`, provided that you add a `locale_alias` parameter. That also means that if you add the behavior to a table without translated columns, and that the translation table is present in the schema, the behavior recognizes them.

So the following schema is exactly equivalent to the first one in this tutorial:

Expand Down
10 changes: 5 additions & 5 deletions docs/behavior/nested_set.txt
Expand Up @@ -2,7 +2,7 @@

[[PageOutline]]

The `nested_set` behavior allows a model to become a tree structure, and provides numerous methods to traverse the tree in an efficient way.
The `nested_set` behavior allows a model to become a tree structure, and provides numerous methods to traverse the tree in an efficient way.

Many applications need to store hierarchical data in the model. For instance, a forum stores a tree of messages for each discussion. A CMS sees sections and subsections as a navigation tree. In a business organization chart, each person is a leaf of the organization tree. [http://en.wikipedia.org/wiki/Nested_set_model Nested sets] are the best way to store such hierachical data in a relational database and manipulate it. The name "nested sets" describes the algorithm used to store the position of a model in the tree ; it is also known as "modified preorder tree traversal".

Expand All @@ -18,7 +18,7 @@ In the `schema.xml`, use the `<behavior>` tag to add the `nested_set` behavior t
</table>
}}}

Rebuild your model, insert the table creation sql again, and you're ready to go. The model now has the ability to be inserted into a tree structure, as follows:
Rebuild your model, insert the table creation sql again, and you're ready to go. The model now has the ability to be inserted into a tree structure, as follows:

{{{
#!php
Expand Down Expand Up @@ -105,12 +105,12 @@ $s2->moveToFirstChildOf($s4);
| \
$s4:Business $s3:Europe
|
$s2:World
$s2:World
*/
}}}

You can delete the descendants of a node using `deleteDescendants()`:

{{{
#!php
<?php
Expand Down Expand Up @@ -193,7 +193,7 @@ foreach ($root->getIterator() as $node) {
}
}}}

The iterator parses the tree in a recursive way by retrieving the children of every node. This can be quite effective on very large trees, since the iterator hydrates only a few objects at a time.
The iterator parses the tree in a recursive way by retrieving the children of every node. This can be quite effective on very large trees, since the iterator hydrates only a few objects at a time.

Beware, though, that the iterator executes many queries to parse a tree. On smaller trees, prefer the `getBranch()` method to execute only one query, and hydrate all records at once:

Expand Down
8 changes: 4 additions & 4 deletions docs/behavior/query_cache.txt
Expand Up @@ -69,17 +69,17 @@ class BookQuery extends BaseBookQuery
{
return $this->getCacheBackend()->test($key);
}

public function cacheFetch($key)
{
return $this->getCacheBackend()->load($key);
}

public function cacheStore($key, $value)
{
return $this->getCacheBackend()->save($key, $value);
}

protected function getCacheBackend()
{
if (self::$cacheBackend === null) {
Expand All @@ -98,7 +98,7 @@ class BookQuery extends BaseBookQuery
);
self::$cacheBackend = Zend_Cache::factory('Core', 'Memcached', $frontendOptions, $backendOptions);
}

return self::$cacheBackend;
}
}
Expand Down
8 changes: 4 additions & 4 deletions docs/behavior/sluggable.txt
Expand Up @@ -114,22 +114,22 @@ The slug is generated by the object when it is saved, via the `createSlug()` met
protected function createSlug()
{
// create the slug based on the `slug_pattern` and the object properties
$slug = $this->createRawSlug();
$slug = $this->createRawSlug();
// truncate the slug to accomodate the size of the slug column
$slug = $this->limitSlugSize($slug);
// add an incremental index to make sure the slug is unique
$slug = $this->makeSlugUnique($slug);

return $slug;
}

protected function createRawSlug()
{
// here comes the string composition code, generated according to `slug_pattern`
$slug = 'posts/' . $this->cleanupSlugPart($this->getTitle());
// cleanupSlugPart() cleans up the slug part
// cleanupSlugPart() cleans up the slug part
// based on the `replace_pattern` and `replacement` parameters

return $slug;
}
}}}
Expand Down
2 changes: 1 addition & 1 deletion docs/behavior/soft_delete.txt
Expand Up @@ -55,7 +55,7 @@ echo $book->getTitle(); // 'War And Peace'

Note that `find()` and other selection methods automatically re-enable the `soft_delete` filter, so `disableSoftDelete()` is really a single shot method. You can also enable the query alteration manually by calling the `enableSoftDelete()` method on Query objects.

'''Tip''': `ModelCriteria::paginate()` executes two queries, so `disableSoftDelete()` doesn't work in this case. Prefer `includeDeleted()` in queries using `paginate()`.
'''Tip''': `ModelCriteria::paginate()` executes two queries, so `disableSoftDelete()` doesn't work in this case. Prefer `includeDeleted()` in queries using `paginate()`.

If you want to recover a deleted object, use the `unDelete()` method:

Expand Down
18 changes: 9 additions & 9 deletions docs/behavior/sortable.txt
Expand Up @@ -2,7 +2,7 @@

[[PageOutline]]

The `sortable` behavior allows a model to become an ordered list, and provides numerous methods to traverse this list in an efficient way.
The `sortable` behavior allows a model to become an ordered list, and provides numerous methods to traverse this list in an efficient way.

== Basic Usage ==

Expand All @@ -16,7 +16,7 @@ In the `schema.xml`, use the `<behavior>` tag to add the `sortable` behavior to
</table>
}}}

Rebuild your model, insert the table creation sql again, and you're ready to go. The model now has the ability to be inserted into an ordered list, as follows:
Rebuild your model, insert the table creation sql again, and you're ready to go. The model now has the ability to be inserted into an ordered list, as follows:

{{{
#!php
Expand Down Expand Up @@ -47,7 +47,7 @@ $secondTask = $firstTask->getNext(); // $t2
$lastTask = $secondTask->getNext(); // $t3
$secondTask = $lastTask->getPrevious(); // $t2

$allTasks = TaskQuery::create()->findList();
$allTasks = TaskQuery::create()->findList();
// => collection($t1, $t2, $t3)
$allTasksInReverseOrder = TaskQuery::create()->orderByRank('desc')->find();
// => collection($t3, $t2, $t2)
Expand All @@ -70,13 +70,13 @@ You can move an object in the list using any of the `moveUp()`, `moveDown()`, `m
{{{
#!php
<?php
// The list is 1 - Wash the dishes, 2 - Do the laundry, 3 - Rest a little
// The list is 1 - Wash the dishes, 2 - Do the laundry, 3 - Rest a little
$t2->moveToTop();
// The list is now 1 - Do the laundry, 2 - Wash the dishes, 3 - Rest a little
$t2->moveToBottom();
// The list is now 1 - Wash the dishes, 2 - Rest a little, 3 - Do the laundry
$t2->moveUp();
// The list is 1 - Wash the dishes, 2 - Do the laundry, 3 - Rest a little
// The list is 1 - Wash the dishes, 2 - Do the laundry, 3 - Rest a little
$t2->swapWith($t1);
// The list is now 1 - Do the laundry, 2 - Wash the dishes, 3 - Rest a little
$t2->moveToRank(3);
Expand All @@ -85,16 +85,16 @@ $t2->moveToRank(2);
}}}

By default, new objects are added at the bottom of the list. But you can also insert them at a specific position, using any of the `insertAtTop(), `insertAtBottom()`, and `insertAtRank()` methods. Note that the `insertAtXXX` methods don't save the object:

{{{
#!php
<?php
// The list is 1 - Wash the dishes, 2 - Do the laundry, 3 - Rest a little
// The list is 1 - Wash the dishes, 2 - Do the laundry, 3 - Rest a little
$t4 = new Task();
$t4->setTitle('Clean windows');
$t4->insertAtRank(2);
$t4->save();
// The list is now 1 - Wash the dishes, 2 - Clean Windows, 3 - Do the laundry, 4 - Rest a little
// The list is now 1 - Wash the dishes, 2 - Clean Windows, 3 - Do the laundry, 4 - Rest a little
}}}

Whenever you `delete()` an object, the ranks are rearranged to fill the gap:
Expand All @@ -103,7 +103,7 @@ Whenever you `delete()` an object, the ranks are rearranged to fill the gap:
#!php
<?php
$t4->delete();
// The list is now 1 - Wash the dishes, 2 - Do the laundry, 3 - Rest a little
// The list is now 1 - Wash the dishes, 2 - Do the laundry, 3 - Rest a little
}}}

'''Tip''': You can remove an object from the list without necessarily deleting it by calling `removeFromList()`. Don't forget to `save()` it afterwards so that the other objects in the lists are rearranged to fill the gap.
Expand Down
2 changes: 1 addition & 1 deletion docs/behavior/versionable.txt
Expand Up @@ -29,7 +29,7 @@ $book = new Book();

// automatic version increment
$book->setTitle('War and Peas');
$book->save();
$book->save();
echo $book->getVersion(); // 1
$book->setTitle('War and Peace');
$book->save();
Expand Down
2 changes: 1 addition & 1 deletion docs/build.xml
Expand Up @@ -7,7 +7,7 @@
<phingcall target="phpdoc-runtime"/>
<phingcall target="phpdoc-generator"/>
</target>

<target name="phpdoc-runtime" description="build runtime docs">
<phpdoc title="Propel Runtime" destdir="api/runtime" sourcecode="yes" output="HTML:Smarty:PHP">
<fileset dir="${runtime.dir}/lib">
Expand Down
6 changes: 3 additions & 3 deletions docs/cookbook/Advanced-Column-Types.txt
Expand Up @@ -110,13 +110,13 @@ Propel offers an `OBJECT` column type to store PHP objects in the database. The
class GeographicCoordinates
{
public $latitude, $longitude;

public function __construct($latitude, $longitude)
{
$this->latitude = $latitude;
$this->longitude = $longitude;
}

public function isInNorthernHemisphere()
{
return $this->latitude > 0;
Expand Down Expand Up @@ -198,4 +198,4 @@ $books = BookQuery::create()

'''Tip''': Filters on array columns translate to SQL as LIKE conditions. That means that the resulting query often requires a full table scan, and is not suited for large tables.

'''Warning''': Only generated Query classes (through generated `filterByXXX()` methods) and `ModelCriteria` (through `where()`, and `condition()`) allow conditions on `ENUM`, `OBJECT`, and `ARRAY` columns. `Criteria` alone (through `add()`, `addAnd()`, and `addOr()`) does not support conditions on such columns.
'''Warning''': Only generated Query classes (through generated `filterByXXX()` methods) and `ModelCriteria` (through `where()`, and `condition()`) allow conditions on `ENUM`, `OBJECT`, and `ARRAY` columns. `Criteria` alone (through `add()`, `addAnd()`, and `addOr()`) does not support conditions on such columns.
8 changes: 4 additions & 4 deletions docs/cookbook/Customizing-Build.txt
Expand Up @@ -83,7 +83,7 @@ Or, for maximum re-usability, you can create a ''<path>'' object, and then refer
<path id="propelclasses">
<pathelement dir="/path/to/propel-generator/classes"/>
</path>

<taskdef
name="propel-om"
classname="propel.phing.PropelOMTask"
Expand Down Expand Up @@ -112,7 +112,7 @@ Now that we've seen the essential elements of our custom build file, it's time t
{{{
<?xml version="1.0">
<project name="propel" default="om">

<!-- set properties we use later -->
<property name="propelgen.home" value="/path/to/propel-generator"/>
<property name="out.dir" value="/var/www/bookstore"/>
Expand All @@ -121,13 +121,13 @@ Now that we've seen the essential elements of our custom build file, it's time t
<path id="propelclasses">
<pathelement dir="${propelgen.home}/classes"/>
</path>

<taskdef
name="propel-om"
classname="propel.phing.PropelOMTask"
classpathRef="propelclasses"/>


<!-- this [default] target performs the work -->
<target name="om" description="build propel om">
<propel-om
Expand Down
2 changes: 1 addition & 1 deletion docs/cookbook/DBDesigner.txt
Expand Up @@ -35,4 +35,4 @@ propel.dbd2propel.dir = ${propel.project.dir}/dbd
propel.dbd2propel.includes = *.xml
# XSLT used to transform DBDesigner files to Propel schemas
propel.dbd2propel.xsl.file = ${propel.home}/resources/xsl/dbd2propel.xsl
}}}
}}}
2 changes: 1 addition & 1 deletion docs/cookbook/Existing-Database.txt
Expand Up @@ -25,7 +25,7 @@ propel.database = mysql
# This must be a PDO DSN
propel.database.url = mysql:dbname=legacyapp
propel.database.user = root
# propel.database.password =
# propel.database.password =
}}}
1. Run the `reverse` task to generate the `schema.xml`:
{{{
Expand Down
2 changes: 1 addition & 1 deletion docs/cookbook/Master-Slave.txt
@@ -1,6 +1,6 @@
= Replication =

Propel can be used in a master-slave replication environment. These environments are set up to improve the performance of web applications by dispatching the database-load to multiple database-servers. While a single master database is responsible for all write-queries, multiple slave-databases handle the read-queries. The slaves are synchronised with the master by a fast binary log (depending on the database).
Propel can be used in a master-slave replication environment. These environments are set up to improve the performance of web applications by dispatching the database-load to multiple database-servers. While a single master database is responsible for all write-queries, multiple slave-databases handle the read-queries. The slaves are synchronised with the master by a fast binary log (depending on the database).

== Configuring Propel for Replication ==

Expand Down

0 comments on commit aaff75d

Please sign in to comment.