Skip to content

Commit

Permalink
code format
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmatic69 committed Feb 2, 2010
1 parent c5ebda9 commit 0267dbc
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 1 deletion.
86 changes: 86 additions & 0 deletions extensions/libs/models/behaviors/automatic_association.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?php
/**
*
*
*/
class AutomaticAssociation extends ModelBehavior{
var $defaults = array(
'active' => true
);

var $AssocModel = null;

function setup(&$model, $settings = array()) {

$default = $this->defaults;

if (!isset($this->__settings[$model->alias])) {
$this->__settings[$model->alias] = $default;
}

$this->__settings[$model->alias] = array_merge($this->__settings[$model->alias], ife(is_array($settings), $settings, array()));

$this->AssocModel = ClassRegistry::init('Association.Associations');

if ($this->__settings[$model->alias]['active']) {
$this->__autoBind();
$this->__autoUnbindBind();
}
}

/**
* Auto bind models.
*
* Checks routes and model loaded to see if it needs to be done
*/
function __autoBind(){
if (false /* 2 way bind */) {
$this->__reverseBind();
}
}


/**
* Auto unbind models.
*
* gets a list of models that can be unbinded, check the routes and
* unbind the correct ones
*/
function __autoUnbindBind(){

}

/**
* public method to easily bind models.
*/
function bindModel($className = null){

}

/**
* public method to easily un-bind models.
*/
function unbindModel($className = null){

}


/**
* Get relations to bind.
*
* get all the items that need to be bound and cache them.
*/
function __getRelationsForBindinig(){

}

/**
* Get relations to un-bind.
*
* get all the items that need to be un=binded and cache them.
*/
function __getRelationsForUnBinding(){

}
}
?>
2 changes: 1 addition & 1 deletion extensions/libs/models/behaviors/commentable.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class CommentableBehavior extends ModelBehavior {
'blacklist_words' => array('.html', '.info', '?', '&', '.de', '.pl', '.cn'),
// List of blacklisted words within URLs
'deletion' => - 10 // How many points till the comment is deleted (negative)
);
);

/**
* Contain settings indexed by model name.
Expand Down

0 comments on commit 0267dbc

Please sign in to comment.