Skip to content

Commit

Permalink
Update documentation, removing references to previous validators
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianoc72 committed May 7, 2012
1 parent f8eb808 commit 3071b95
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 249 deletions.
3 changes: 1 addition & 2 deletions documentation/cookbook/runtime-introspection.markdown
Expand Up @@ -7,7 +7,7 @@ title: Model Introspection At Runtime

In addition to the object and peer classes used to do C.R.U.D. operations, Propel generates an object mapping for your tables to allow runtime introspection.

The intospection objects are instances of the map classes. Propel maps databases, tables, columns, validators, and relations into objects that you can easily use.
The intospection objects are instances of the map classes. Propel maps databases, tables, columns and relations into objects that you can easily use.

## Retrieving a TableMap ##

Expand Down Expand Up @@ -82,7 +82,6 @@ $bookTitleColumn->isNumeric(); // false
$bookTitleColumn->isText(); // true
$bookTitleColumn->isPrimaryKey(); // false
$bookTitleColumn->isForeignKey(); // false
$bookTitleColumn->hasValidators(); // false
$bookTitleColumn->isPrimaryString(); // true
{% endhighlight %}

Expand Down
2 changes: 1 addition & 1 deletion documentation/cookbook/writing-behavior.markdown
Expand Up @@ -93,7 +93,7 @@ class AggregateColumnBehavior extends Behavior

This method shows that a behavior class has access to the `<parameters>` defined for it in the `schema.xml` through the `getParameter()` command. Behaviors can also always access the `Table` object attached to them, by calling `getTable()`. A `Table` can check if a column exists and add a new one easily. The `Table` class is one of the numerous generator classes that serve to describe the object model at buildtime, together with `Column`, `ForeignKey`, `Index`, and a lot more classes. You can find all the buildtime model classes under the `generator/lib/model` directory.

_Tip_: Don't mix up the _runtime_ database model (`DatabaseMap`, `TableMap`, `ColumnMap`, `ValidatorMap`, `RelationMap`) with the _buildtime_ database model (`Database`, `Table`, `Column`, `Validator`, etc.). The buildtime model is very detailed, in order to ease the work of the builders that write the ActiveRecord and Query classes. On the other hand, the runtime model is optimized for speed, and carries minimal information to allow correct hydration and binding at runtime. Behaviors use the buildtime object model, because they are run at buildtime, so they have access to the most powerful model.
_Tip_: Don't mix up the _runtime_ database model (`DatabaseMap`, `TableMap`, `ColumnMap`, `RelationMap`) with the _buildtime_ database model (`Database`, `Table`, `Column`, etc.). The buildtime model is very detailed, in order to ease the work of the builders that write the ActiveRecord and Query classes. On the other hand, the runtime model is optimized for speed, and carries minimal information to allow correct hydration and binding at runtime. Behaviors use the buildtime object model, because they are run at buildtime, so they have access to the most powerful model.

Now rebuild the model and the SQL, and sure enough, the new column is there. `BasePollQuestion` offers a `getTotalNbVotes()` and a `setTotalNbVotes()` method, and the table creation SQL now includes the additional `total_nb_votes` column:

Expand Down
240 changes: 0 additions & 240 deletions documentation/documentation/05-validators.markdown

This file was deleted.

2 changes: 1 addition & 1 deletion documentation/documentation/09-inheritance.markdown
Expand Up @@ -369,7 +369,7 @@ Since the columns of the main table are copied to the child tables, this schema
</table>
{% endhighlight %}

>**Tip**<br />The `concrete_inheritance` behavior copies columns, foreign keys, indices and validators.
>**Tip**<br />The `concrete_inheritance` behavior copies columns, foreign keys and indices. If you've configured the `validate` behavior, it copies also validators.

### Using Inherited Model Classes ###

Expand Down
1 change: 0 additions & 1 deletion documentation/documentation/index.markdown
Expand Up @@ -18,7 +18,6 @@ title: Documentation

* [Basic CRUD](03-basic-crud.html) The basics of Propel C.R.U.D. (Create, Retrieve, Update, Delete) operations
* [Relationships](04-relationships.html) Searching and manipulating data from related tables.
* [Validators](05-validators.html) The validation framework checks data before insertion based on column type.
* [Transactions](06-transactions.html) Where and when to use transactions.
* [Behaviors](07-behaviors.html) The behavior system allows to package and reuse common model features.
* [Logging And Debugging](08-logging.html) Propel can log a lot of information, including the SQL queries it executes.
Expand Down
8 changes: 4 additions & 4 deletions documentation/reference/active-record.markdown
Expand Up @@ -250,7 +250,7 @@ echo $book->getAuthor()->getLastName(); // Tolstoi
<reference local="author_id" foreign="id" />
</foreign-key>
</table>
<!-- Generated methods will then be Book::setWriter(), and Book::getWriter()
<!-- Generated methods will then be Book::setWriter(), and Book::getWriter() -->
{% endhighlight %}

### Many-to-one Relationships ###
Expand Down Expand Up @@ -280,7 +280,7 @@ $author->clearBooks(); // removes the relationship
</foreign-key>
</table>
<!-- Generated methods will then be Author::addPublication(), Author::getPublications(),
Author::countPublications(), and Author::clearPublications()
Author::countPublications(), and Author::clearPublications() -->
{% endhighlight %}

### Many-to-many relationships ###
Expand Down Expand Up @@ -522,7 +522,7 @@ propel.addGenericMutators = false

## Validation ##

Active Record classes for tables using validation rules (defined in the schema using the `<validator>` and `<rule>` tags) have two additional methods: `validate()`, and `getValidationFailures()`.
Active Record classes for tables using validate behavior have three additional methods: `validate()`, `getValidationFailures()` and `loadValidatorMetadata()`.

{% highlight php %}
<?php
Expand All @@ -540,7 +540,7 @@ if ($book->validate()) {
}
{% endhighlight %}

See the [Validators documentation](../documentation/05-validators) for more details.
See the [Validate behavior documentation](../behaviors/validate.html) for more details.

## Import and Export Capabilities ##

Expand Down

0 comments on commit 3071b95

Please sign in to comment.