/**
  * Initializes the model and Propel behaviors by adding all the appropriate hooks only once.
  */
 protected function setupModelOneTime()
 {
     if (!$this->model_setup) {
         sfPropelBehavior::registerHooks('search', array(':save:pre' => array('sfSolrPropelBehavior', 'preSave'), ':save:post' => array('sfSolrPropelBehavior', 'postSave'), ':delete:pre' => array('sfSolrPropelBehavior', 'preDelete'), ':delete:post' => array('sfSolrPropelBehavior', 'postDelete')));
         sfPropelBehavior::registerMethods('search', array(array('sfSolrPropelBehavior', 'saveIndex'), array('sfSolrPropelBehavior', 'deleteIndex'), array('sfSolrPropelBehavior', 'insertIndex')));
         $this->model_setup = true;
     }
 }
 public function initialize()
 {
     parent::initialize();
     // Register behavior's hooks
     sfPropelBehavior::registerHooks('studentCareerSchoolYear', array(':save:pre' => array('StudentCareerSchoolYearBehavior', 'createStudentCareerSchoolYear')));
     //sfPropelBehavior::registerHooks('examination', array(
     //  ':save:pre' => array('ExaminationBehavior', 'createExaminationSubjects'),
     //));
     sfPropelBehavior::registerHooks('examination_subject', array(':save:pre' => array('ExaminationSubjectBehavior', 'updateCourseSubjectStudentExaminations')));
     sfPropelBehavior::registerHooks('examination_repproved_subject', array(':save:pre' => array('ExaminationRepprovedSubjectBehavior', 'updateStudentExaminationRepprovedSubjects')));
     sfPropelBehavior::registerHooks('student_approved_career_subject', array(':save:post' => array('StudentApprovedCareerSubjectBehavior', 'graduateStudent')));
     sfPropelBehavior::registerHooks('student_approved_course_subject', array(':save:post' => array('StudentRepprovedCourseSubjectBehavior', 'checkRepeatition')));
     sfPropelBehavior::registerHooks('student_reincorporation_save', array(':save:post' => array('StudentReincorporationBehavior', 'updateReincorporation')));
     sfPropelBehavior::registerHooks('student_reincorporation_delete', array(':delete:pre' => array('StudentReincorporationBehavior', 'deleteReincorporation')));
     sfPropelBehavior::registerHooks('career_subject_school_year_update', array(':save:post' => array('CareerSubjectSchoolYearBehavior', 'updateCareerSubjectSchoolYear')));
     sfPropelBehavior::registerHooks('person_delete', array(':delete:pre' => array('PersonBehavior', 'deletePerson')));
     spl_autoload_register(array('ncFlavorAutoload', 'initialize'));
 }
示例#3
0
<?php

// Register behavior's method
sfPropelBehavior::registerMethods('changelog', array(array('ncPropelChangeLogBehavior', 'getChangeLog'), array('ncPropelChangeLogBehavior', 'hasChangeLog'), array('ncPropelChangeLogBehavior', 'get1NRelatedChangeLog'), array('ncPropelChangeLogBehavior', 'getNNRelatedChangeLog'), array('ncPropelChangeLogBehavior', 'getChangeLogRoute')));
// Register behavior's hooks
sfPropelBehavior::registerHooks('changelog', array(':save:pre' => array('ncPropelChangeLogBehavior', 'preSave'), ':save:post' => array('ncPropelChangeLogBehavior', 'postSave'), ':delete:post' => array('ncPropelChangeLogBehavior', 'postDelete')));
 /**
  * Singleton constructor.
  * Initializes the model and Propel behaviors by adding all the appropriate hooks only once.
  */
 protected function __construct()
 {
     sfPropelBehavior::registerHooks('search', array(':save:pre' => array('sfLucenePropelBehavior', 'preSave'), ':save:post' => array('sfLucenePropelBehavior', 'postSave'), ':delete:pre' => array('sfLucenePropelBehavior', 'preDelete'), ':delete:post' => array('sfLucenePropelBehavior', 'postDelete')));
     sfPropelBehavior::registerMethods('search', array(array('sfLucenePropelBehavior', 'saveIndex'), array('sfLucenePropelBehavior', 'deleteIndex'), array('sfLucenePropelBehavior', 'insertIndex')));
 }
示例#5
0
<?php

sfPropelBehavior::registerMethods('paranoid', array(array('sfPropelParanoidBehavior', 'forceDelete')));
sfPropelBehavior::registerHooks('paranoid', array(':delete:pre' => array('sfPropelParanoidBehavior', 'preDelete'), 'Peer:doSelectRS' => array('sfPropelParanoidBehavior', 'doSelectRS')));
<?php

// include project configuration
include SF_ROOT_DIR . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.php';
// symfony bootstraping
require_once $sf_symfony_lib_dir . '/util/sfCore.class.php';
sfCore::bootstrap($sf_symfony_lib_dir, $sf_symfony_data_dir);
// wikifiable behavior: hook per metodi preSave e postSave
// aggiunge descrizione in pagina wiki dopo la creazione di un atto o votazione
// la descrizione è aggiunta solo se si tratta di un nuovo oggetto (non per update)
sfPropelBehavior::registerHooks('wikifiableBehavior', array(':save:pre' => array('wikifiableBehavior', 'preSave'), ':save:post' => array('wikifiableBehavior', 'postSave'), ':delete:pre' => array('wikifiableBehavior', 'preDelete')));
// need to include this to use the api.yml config file
require_once sfConfigCache::getInstance()->checkConfig('config/api.yml');
 /**
  * Register empty 'changelog' behaviors to avoid error message
  */
 protected function registerBehavior()
 {
     sfPropelBehavior::registerMethods('changelog', array());
     sfPropelBehavior::registerHooks('changelog', array());
 }
示例#8
0
<?php

/*
 * This file is part of the sfPropelActAsTaggableBehavior package.
 * 
 * (c) 2007 Guillermo Rauch <*****@*****.**>
 * 
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
sfPropelBehavior::registerHooks('sfPropelActAsSluggableBehavior', array(':save:pre' => array('sfPropelActAsSluggableBehavior', 'preSave')));
示例#9
0
<?php

/*
 * This file is part of the sfPropelActAsCountableBehavior package.
 * 
 * (c) 2008 Xavier Lacot <*****@*****.**>
 * 
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
if (in_array('sfCounter', sfConfig::get('sf_enabled_modules', array()))) {
    $r = sfRouting::getInstance();
    $r->prependRoute('sf_counter', '/sfCounter/increment/*', array('module' => 'sfCounter', 'action' => 'incrementCounter'));
}
sfPropelBehavior::registerHooks('sfPropelActAsCountableBehavior', array(':delete:post' => array('sfPropelActAsCountableBehavior', 'postDelete')));
sfPropelBehavior::registerMethods('sfPropelActAsCountableBehavior', array(array('sfPropelActAsCountableBehavior', 'decrementCounter'), array('sfPropelActAsCountableBehavior', 'forceCounter'), array('sfPropelActAsCountableBehavior', 'getCounter'), array('sfPropelActAsCountableBehavior', 'incrementCounter'), array('sfPropelActAsCountableBehavior', 'resetCounter'), array('sfPropelActAsCountableBehavior', 'saveCounter')));
示例#10
0
文件: config.php 项目: anvaya/nckids
<?php

sfPropelBehavior::registerMethods('paranoid', array(array('sfPropelParanoidBehavior', 'forceDelete')));
sfPropelBehavior::registerHooks('paranoid', array(':delete:pre' => array('sfPropelParanoidBehavior', 'preDelete'), 'Peer:doSelectStmt' => array('sfPropelParanoidBehavior', 'doSelectStmt'), 'Peer:doSelectJoin' => array('sfPropelParanoidBehavior', 'doSelectStmt'), 'Peer:doSelectJoinAll' => array('sfPropelParanoidBehavior', 'doSelectStmt'), 'Peer:doSelectJoinAllExcept' => array('sfPropelParanoidBehavior', 'doSelectStmt')));
示例#11
0
<?php

/*
 * This file is part of the sfPropelActAsTaggableBehavior package.
 *
 * (c) 2007 Xavier Lacot <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
sfPropelBehavior::registerHooks('sfPropelActAsTaggableBehavior', array(':save:post' => array('sfPropelActAsTaggableBehavior', 'postSave')));
sfPropelBehavior::registerMethods('sfPropelActAsTaggableBehavior', array(array('sfPropelActAsTaggableBehavior', 'addTag'), array('sfPropelActAsTaggableBehavior', 'getTags'), array('sfPropelActAsTaggableBehavior', 'hasTag'), array('sfPropelActAsTaggableBehavior', 'removeAllTags'), array('sfPropelActAsTaggableBehavior', 'removeTag'), array('sfPropelActAsTaggableBehavior', 'replaceTag'), array('sfPropelActAsTaggableBehavior', 'setTags')));
示例#12
0
<?php

sfPropelBehavior::registerHooks('sfPropelApprovableBehavior', array(':save:post' => array('sfPropelApprovableBehavior', 'postSave'), 'Peer:doSelectRS' => array('sfPropelApprovableBehavior', 'doSelectRS')));
sfPropelBehavior::registerMethods('sfPropelApprovableBehavior', array(array('sfPropelApprovableBehavior', 'getApproval'), array('sfPropelApprovableBehavior', 'getApprovalUrl')));
示例#13
0
<?php

/*
 * This file is part of the deppPropelActAsTaggableBehavior package.
 *
 * (c) 2007 Guglielmo Celata <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
sfPropelBehavior::registerHooks('deppPropelActAsTaggableBehavior', array(':save:post' => array('deppPropelActAsTaggableBehavior', 'postSave'), ':delete:pre' => array('deppPropelActAsTaggableBehavior', 'preDelete')));
sfPropelBehavior::registerMethods('deppPropelActAsTaggableBehavior', array(array('deppPropelActAsTaggableBehavior', 'addTag'), array('deppPropelActAsTaggableBehavior', 'getTags'), array('deppPropelActAsTaggableBehavior', 'getUserTags'), array('deppPropelActAsTaggableBehavior', 'hasTag'), array('deppPropelActAsTaggableBehavior', 'removeAllTags'), array('deppPropelActAsTaggableBehavior', 'removeTag'), array('deppPropelActAsTaggableBehavior', 'replaceTag'), array('deppPropelActAsTaggableBehavior', 'setTags'), array('deppPropelActAsTaggableBehavior', 'getTagsAsObjects'), array('deppPropelActAsTaggableBehavior', 'getTagsAsTaggingObjects')));
示例#14
0
 * This file is part of the deppPropelMonitoringBehavior package.
 *
 * (c) 2008 Guglielmo Celata <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
/**
 * hooks and methods for the actAsMonitorable behavior
 *
 **/
sfPropelBehavior::registerHooks('deppPropelActAsMonitorableBehavior', array(':delete:pre' => array('deppPropelActAsMonitorableBehavior', 'preDelete')));
sfPropelBehavior::registerMethods('deppPropelActAsMonitorableBehavior', array(array('deppPropelActAsMonitorableBehavior', 'addMonitoringUser'), array('deppPropelActAsMonitorableBehavior', 'removeMonitoringUser'), array('deppPropelActAsMonitorableBehavior', 'isMonitoredByUser'), array('deppPropelActAsMonitorableBehavior', 'getMonitoringUsersPKs'), array('deppPropelActAsMonitorableBehavior', 'getMonitoringUsers'), array('deppPropelActAsMonitorableBehavior', 'countMonitoringUsers'), array('deppPropelActAsMonitorableBehavior', 'getNNewNews'), array('deppPropelActAsMonitorableBehavior', 'getLastNews')));
/**
 * hooks and methods for the actAsMonitorer behavior
 *
 **/
sfPropelBehavior::registerHooks('deppPropelActAsMonitorerBehavior', array(':delete:pre' => array('deppPropelActAsMonitorerBehavior', 'preDelete')));
sfPropelBehavior::registerMethods('deppPropelActAsMonitorerBehavior', array(array('deppPropelActAsMonitorerBehavior', 'addMonitoredObject'), array('deppPropelActAsMonitorerBehavior', 'removeMonitoredObject'), array('deppPropelActAsMonitorerBehavior', 'removeAllMonitoredObjects'), array('deppPropelActAsMonitorerBehavior', 'getMonitoredPks'), array('deppPropelActAsMonitorerBehavior', 'getMonitoredObjects'), array('deppPropelActAsMonitorerBehavior', 'countMonitoredObjects'), array('deppPropelActAsMonitorerBehavior', 'isMonitoring')));
/**
 * hooks and methods for the actAsNewsGenerator behavior
 *
 **/
sfPropelBehavior::registerHooks('deppPropelActAsNewsGeneratorBehavior', array(':delete:pre' => array('deppPropelActAsNewsGeneratorBehavior', 'preDelete'), ':save:pre' => array('deppPropelActAsNewsGeneratorBehavior', 'preSave'), ':save:post' => array('deppPropelActAsNewsGeneratorBehavior', 'postSave')));
sfPropelBehavior::registerMethods('deppPropelActAsNewsGeneratorBehavior', array(array('deppPropelActAsNewsGeneratorBehavior', 'generateNews'), array('deppPropelActAsNewsGeneratorBehavior', 'getGeneratedNews'), array('deppPropelActAsNewsGeneratorBehavior', 'getPrimaryKeysArray'), array('deppPropelActAsNewsGeneratorBehavior', 'getNewsDate'), array('deppPropelActAsNewsGeneratorBehavior', 'getNewsPriority'), array('deppPropelActAsNewsGeneratorBehavior', 'getRelatedMonitorableObjects'), array('deppPropelActAsNewsGeneratorBehavior', 'getRelatedMonitorableObject')));
/**
 * hooks and methods for the actAsCommunityNewsGenerator behavior
 *
 **/
sfPropelBehavior::registerHooks('deppPropelActAsCommunityNewsGeneratorBehavior', array(':delete:pre' => array('deppPropelActAsCommunityNewsGeneratorBehavior', 'preDelete'), ':save:pre' => array('deppPropelActAsCommunityNewsGeneratorBehavior', 'preSave'), ':save:post' => array('deppPropelActAsCommunityNewsGeneratorBehavior', 'postSave')));
sfPropelBehavior::registerMethods('deppPropelActAsCommunityNewsGeneratorBehavior', array(array('deppPropelActAsCommunityNewsGeneratorBehavior', 'generateCreationCommunityNews'), array('deppPropelActAsCommunityNewsGeneratorBehavior', 'generateRemovalCommunityNews'), array('deppPropelActAsCommunityNewsGeneratorBehavior', 'getGeneratedNews'), array('deppPropelActAsCommunityNewsGeneratorBehavior', 'getPrimaryKeysArray'), array('deppPropelActAsCommunityNewsGeneratorBehavior', 'getRelatedObject')));
示例#15
0
文件: config.php 项目: net7/Talia-CMS
<?php

/*
 * This file is part of the sfPropelActAsNestedSetBehavior package.
 * 
 * (c) 2007 Tristan Rivoallan <*****@*****.**>
 * 
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
sfPropelBehavior::registerHooks('actasnestedset', array(':save:pre' => array('sfPropelActAsNestedSetBehavior', 'preSave'), ':delete:pre' => array('sfPropelActAsNestedSetBehavior', 'preDelete')));
sfPropelBehavior::registerMethods('actasnestedset', array(array('sfPropelActAsNestedSetBehavior', 'getLeftValue'), array('sfPropelActAsNestedSetBehavior', 'getRightValue'), array('sfPropelActAsNestedSetBehavior', 'getParentIdValue'), array('sfPropelActAsNestedSetBehavior', 'getScopeIdValue'), array('sfPropelActAsNestedSetBehavior', 'setLeftValue'), array('sfPropelActAsNestedSetBehavior', 'setRightValue'), array('sfPropelActAsNestedSetBehavior', 'setParentIdValue'), array('sfPropelActAsNestedSetBehavior', 'setScopeIdValue'), array('sfPropelActAsNestedSetBehavior', 'makeRoot'), array('sfPropelActAsNestedSetBehavior', 'insertAsFirstChildOf'), array('sfPropelActAsNestedSetBehavior', 'insertAsLastChildOf'), array('sfPropelActAsNestedSetBehavior', 'insertAsNextSiblingOf'), array('sfPropelActAsNestedSetBehavior', 'insertAsPrevSiblingOf'), array('sfPropelActAsNestedSetBehavior', 'insertAsParentOf'), array('sfPropelActAsNestedSetBehavior', 'hasChildren'), array('sfPropelActAsNestedSetBehavior', 'getChildren'), array('sfPropelActAsNestedSetBehavior', 'getParent'), array('sfPropelActAsNestedSetBehavior', 'getNumberOfChildren'), array('sfPropelActAsNestedSetBehavior', 'getDescendants'), array('sfPropelActAsNestedSetBehavior', 'getNumberOfDescendants'), array('sfPropelActAsNestedSetBehavior', 'isRoot'), array('sfPropelActAsNestedSetBehavior', 'hasParent'), array('sfPropelActAsNestedSetBehavior', 'hasNextSibling'), array('sfPropelActAsNestedSetBehavior', 'hasPrevSibling'), array('sfPropelActAsNestedSetBehavior', 'isLeaf'), array('sfPropelActAsNestedSetBehavior', 'isEqualTo'), array('sfPropelActAsNestedSetBehavior', 'isChildOf'), array('sfPropelActAsNestedSetBehavior', 'isDescendantOf'), array('sfPropelActAsNestedSetBehavior', 'moveToFirstChildOf'), array('sfPropelActAsNestedSetBehavior', 'moveToLastChildOf'), array('sfPropelActAsNestedSetBehavior', 'moveToNextSiblingOf'), array('sfPropelActAsNestedSetBehavior', 'moveToPrevSiblingOf'), array('sfPropelActAsNestedSetBehavior', 'deleteChildren'), array('sfPropelActAsNestedSetBehavior', 'deleteDescendants'), array('sfPropelActAsNestedSetBehavior', 'retrieveFirstChild'), array('sfPropelActAsNestedSetBehavior', 'retrieveLastChild'), array('sfPropelActAsNestedSetBehavior', 'retrieveNextSibling'), array('sfPropelActAsNestedSetBehavior', 'retrievePrevSibling'), array('sfPropelActAsNestedSetBehavior', 'retrieveParent'), array('sfPropelActAsNestedSetBehavior', 'retrieveSiblings'), array('sfPropelActAsNestedSetBehavior', 'getLevel'), array('sfPropelActAsNestedSetBehavior', 'setLevel'), array('sfPropelActAsNestedSetBehavior', 'getPath'), array('sfPropelActAsNestedSetBehavior', 'reload')));
示例#16
0
<?php

/*
 * This file is part of the deppPropelActAsCommentableBehavior package.
 * 
 * (c) 2008 Guglielmo Celata <*****@*****.**>
 * based on sfPropelActAsCommentable, by Xavier Lacot <*****@*****.**>
 * 
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
sfPropelBehavior::registerHooks('deppPropelActAsCommentableBehavior', array(':delete:pre' => array('deppPropelActAsCommentableBehavior', 'preDelete')));
sfPropelBehavior::registerMethods('deppPropelActAsCommentableBehavior', array(array('deppPropelActAsCommentableBehavior', 'addComment'), array('deppPropelActAsCommentableBehavior', 'clearComments'), array('deppPropelActAsCommentableBehavior', 'getComments'), array('deppPropelActAsCommentableBehavior', 'getPublicComments'), array('deppPropelActAsCommentableBehavior', 'getNbComments'), array('deppPropelActAsCommentableBehavior', 'getNbPublicComments'), array('deppPropelActAsCommentableBehavior', 'removeComment'), array('deppPropelActAsCommentableBehavior', 'publishComment'), array('deppPropelActAsCommentableBehavior', 'unpublishComment')));
<?php

sfPropelBehavior::registerHooks('sfPropelActAsSlopeOneRateableBehavior', array());
sfPropelBehavior::registerHooks('sfPropelActAsSlopeOneRaterBehavior', array());
sfPropelBehavior::registerMethods('sfPropelActAsSlopeOneRateableBehavior', array(array('sfPropelActAsSlopeOneRateableBehavior', 'getRecommendations')));
sfPropelBehavior::registerMethods('sfPropelActAsSlopeOneRaterBehavior', array(array('sfPropelActAsSlopeOneRaterBehavior', 'getRecommendations')));
示例#18
0
<?php

sfPropelBehavior::registerHooks('audit', array(':delete:post' => array('sfPropelAuditBehavior', 'postDelete'), 'Peer:doInsert:post' => array('sfPropelAuditBehavior', 'postDoInsert'), 'Peer:doUpdate:post' => array('sfPropelAuditBehavior', 'postDoUpdate')));
示例#19
0
<?php

/*
 * This file is part of the sfPropelVersionableBehaviorPlugin package.
 * 
 * (c) 2007 Tristan Rivoallan <*****@*****.**>
 * 
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
sfPropelBehavior::registerHooks('versionable', array(':save:pre' => array('sfPropelVersionableBehavior', 'preSave'), ':save:post' => array('sfPropelVersionableBehavior', 'postSave'), ':delete:post' => array('sfPropelVersionableBehavior', 'postDelete')));
sfPropelBehavior::registerMethods('versionable', array(array('sfPropelVersionableBehavior', 'toVersion'), array('sfPropelVersionableBehavior', 'getAllVersions'), array('sfPropelVersionableBehavior', 'getAllResourceVersions'), array('sfPropelVersionableBehavior', 'getLastResourceVersion'), array('sfPropelVersionableBehavior', 'getCurrentResourceVersion'), array('sfPropelVersionableBehavior', 'setVersion'), array('sfPropelVersionableBehavior', 'getVersion'), array('sfPropelVersionableBehavior', 'setVersionComment'), array('sfPropelVersionableBehavior', 'getVersionComment'), array('sfPropelVersionableBehavior', 'setVersionCreatedBy'), array('sfPropelVersionableBehavior', 'getVersionCreatedBy'), array('sfPropelVersionableBehavior', 'getVersionCreatedAt'), array('sfPropelVersionableBehavior', 'addVersion')));
示例#20
0
<?php

/*
 * This file is part of the sfPropelActAsStarredBehavior package.
 *
 * (c) 2007 Gerald Estadieu <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
sfPropelBehavior::registerHooks('sfPropelActAsStarredBehavior', array(':delete:pre' => array('sfPropelActAsStarredBehavior', 'preDelete')));
sfPropelBehavior::registerMethods('sfPropelActAsStarredBehavior', array(array('sfPropelActAsStarredBehavior', 'setStar'), array('sfPropelActAsStarredBehavior', 'countStars'), array('sfPropelActAsStarredBehavior', 'isStarred'), array('sfPropelActAsStarredBehavior', 'clearStar')));
示例#21
0
<?php

/**
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 * 
 * @package  sfPropelUuidBehaviorPlugin
 * @author   Tristan Rivoallan <*****@*****.**>
 * @license  http://www.opensource.org/licenses/mit-license.php MIT
 */
sfPropelBehavior::registerHooks('sfPropelUuidBehavior', array(':save:pre' => array('sfPropelUuidBehavior', 'preSave')));
sfPropelBehavior::registerMethods('sfPropelUuidBehavior', array('getUuid' => array('sfPropelUuidBehavior', 'getUuid'), 'setUuid' => array('sfPropelUuidBehavior', 'setUuid')));