当前位置: 首页>>代码示例>>PHP>>正文


PHP sfPropelBehavior::add方法代码示例

本文整理汇总了PHP中sfPropelBehavior::add方法的典型用法代码示例。如果您正苦于以下问题:PHP sfPropelBehavior::add方法的具体用法?PHP sfPropelBehavior::add怎么用?PHP sfPropelBehavior::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sfPropelBehavior的用法示例。


在下文中一共展示了sfPropelBehavior::add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getSlug

            $document->hasDescrizioneWiki = false;
        }
        if ($this->getOppSeduta()->getData()) {
            $document->data_pres_dt = $this->getOppSeduta()->getData('%Y-%m-%dT%H:%M:%SZ');
        }
        // ritorna il documento da aggiungere
        return $document;
    }
    public function getSlug()
    {
        return Util::slugify($this->getTitolo());
    }
    /**
     *
     * @author Daniele Faraglia
     * @return string parametri per completare l'url della route
     */
    public function getUrlParams()
    {
        $str = 'id=' . $this->getId();
        $str .= '&slug=' . $this->getSlug();
        $str .= '&ramo=' . ($this->getOppSeduta()->getRamo() == 'C' ? 'camera' : 'senato');
        return $str;
    }
}
sfPropelBehavior::add('OppVotazione', array('deppPropelActAsVotableBehavior' => array('voting_range' => 1, 'voting_fields' => array(1 => 'UtFav', -1 => 'UtContr'), 'neutral_position' => false, 'anonymous_voting' => false, 'clear_cache_after_update' => true)));
sfPropelBehavior::add('OppVotazione', array('wikifiableBehavior' => array('prefix' => 'votazione', 'default_description' => "Inserire qui una descrizione della votazione.", 'default_user_comment' => 'Creazione iniziale')));
sfPropelBehavior::add('OppVotazione', array('deppPropelActAsTaggableBehavior'));
sfPropelBehavior::add('OppVotazione', array('deppPropelActAsCommentableBehavior'));
sfPropelBehavior::add('OppVotazione', array('deppPropelActAsLaunchableBehavior'));
sfSolrPropelBehavior::getInitializer()->setupModel('OppVotazione');
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:31,代码来源:OppVotazione.php

示例2: array

<?php

/**
 * Subclass for representing a row from the 'sf_test_object' table.
 *
 * 
 *
 * @package lib.model
 */
class sfTestObject extends BasesfTestObject
{
}
/*
sfPropelBehavior::add(
  'sfTestObject', 
  array('deppPropelActAsCommentableBehavior' =>
        array('count_cache_enabled'   => true,
              'count_cache_method'    => 'setSfCommentCount')));
*/
sfPropelBehavior::add('sfTestObject', array('deppPropelActAsEmendableBehavior' => array('count_cache_enabled' => true, 'count_cache_method' => 'setSfCommentCount')));
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:20,代码来源:sfTestObject.php

示例3: intoSolrDocument

            $this->skip_news_generation = false;
        }
        return parent::save();
    }
    /**
     * torna l'oggetto Apache_Solr_Document da indicizzare
     *
     * @return Apache_Solr_Document
     * @author Guglielmo Celata
     */
    public function intoSolrDocument()
    {
        $document = new Apache_Solr_Document();
        $id = $this->getId();
        $document->id = md5('OppDocumento' . $id);
        $document->sfl_model = 'OppDocumento';
        $document->sfl_type = 'model';
        $document->tipo_atto_s = strtolower($this->getOppAtto()->getTipoAtto());
        $document->propel_id = $id;
        $document->titolo = strip_tags(str_replace("'", "\\'", $this->getTitoloCompleto()));
        $document->testo = strip_tags(str_replace("'", "\\'", $this->getTesto()));
        if ($this->getData()) {
            $document->data_pres_dt = $this->getData('%Y-%m-%dT%H:%M:%SZ');
        }
        $document->created_at_dt = $this->getCreatedAt('%Y-%m-%dT%H:%M:%SZ');
        // ritorna il documento da aggiungere
        return $document;
    }
}
sfPropelBehavior::add('OppDocumento', array('deppPropelActAsNewsGeneratorBehavior' => array('monitorable_models' => array('OppAtto' => 'getOppAtto'), 'date_method' => 'Data', 'priority' => '2')));
sfSolrPropelBehavior::getInitializer()->setupModel('OppDocumento');
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:31,代码来源:OppDocumento.php

示例4: array

<?php

/**
 * Subclass for representing a row from the 'ct_position_application' table.
 *
 * 
 *
 * @package lib.model
 */
class PositionApplication extends BasePositionApplication
{
}
sfPropelBehavior::add('PositionApplication', array('sfPropelActAsCommentableBehavior'));
sfPropelBehavior::add('PositionApplication', array('sfPropelUuidBehavior'));
sfPropelBehavior::add('PositionApplication', array('sfPropelActAsStarredBehavior'));
开发者ID:sgrove,项目名称:cothinker,代码行数:15,代码来源:PositionApplication.php

示例5: getStringMark

        return SchoolBehaviourFactory::getInstance()->getShortFreeLabel($this);
    }
    public function getStringMark()
    {
        return $this->__toString();
    }
    public function getColor()
    {
        return SchoolBehaviourFactory::getEvaluatorInstance()->getColorForCourseSubjectStudentMark($this);
    }
    public function getMarkByConfig($config = null)
    {
        if (is_null($config)) {
            $config = $this->getCourseSubjectStudent()->getCourseSubject()->getCareerSubjectSchoolYear()->getConfiguration();
        }
        if ($this->getMark() != 0) {
            if (!is_null($config) && !$config->isNumericalMark()) {
                $letter_mark = LetterMarkPeer::getLetterMarkByValue((int) $this->getMark());
                return $letter_mark->getLetter();
            } else {
                return $this->getMark();
            }
        } elseif ($this->getIsFree()) {
            return "Libre";
        } else {
            return $this->getMark();
        }
    }
}
sfPropelBehavior::add('CourseSubjectStudentMark', array('changelog'));
开发者ID:nvidela,项目名称:kimkelen,代码行数:30,代码来源:CourseSubjectStudentMark.php

示例6: needsCommit

<?php

/**
 * Subclass for representing a row from the 'records' table.
 *
 * 
 *
 * @package lib.model
 */
class Record extends BaseRecord
{
    public function needsCommit()
    {
        $connection = Propel::getConnection();
        $sql = sprintf("SELECT COUNT(%s) AS count FROM %s \n      WHERE %s = 'Record' \n      AND %s = %d \n      AND %s = %d \n      AND %s > '%s'", AuditPeer::ID, AuditPeer::TABLE_NAME, AuditPeer::OBJECT, AuditPeer::OBJECT_KEY, $this->getId(), AuditPeer::DOMAIN_ID, $this->getDomainId(), AuditPeer::CREATED_AT, date("Y-m-d H:i:s", MyTools::getLastCommit()));
        $statement = $connection->prepareStatement($sql);
        $resultset = $statement->executeQuery();
        $resultset->next();
        return $resultset->getInt('count');
    }
}
sfPropelBehavior::add('Record', array('audit'));
开发者ID:royalterra,项目名称:pdns-gui,代码行数:22,代码来源:Record.php

示例7: setupModel

 /**
  * Sets up the provided model by adding propel behaviors.  It pulls the data to use for this
  * in the search.yml file.
  * @param string $model The model name to setup.
  */
 public function setupModel($model)
 {
     $this->setupModelOneTime();
     sfPropelBehavior::add($model, array('search' => array()));
     return $this;
 }
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:11,代码来源:sfSolrPropelInitializer.class.php

示例8: __toString

<?php

/**
 * Subclass for representing a row from the 'ct_campus' table.
 *
 * 
 *
 * @package lib.model
 */
class Campus extends BaseCampus
{
    public function __toString()
    {
        return $this->getName();
    }
    public function getAboutBrief($length = 100)
    {
        if (strlen($this->getAbout()) > $length + 3) {
            return substr($this->getAbout(), 0, $length) . '...';
        }
        return $this->getAbout();
    }
}
$columns_map = array('from' => CampusPeer::NAME, 'to' => CampusPeer::SLUG);
sfPropelBehavior::add('Campus', array('sfPropelActAsSluggableBehavior' => array('columns' => $columns_map, 'separator' => '_', 'permanent' => false)));
sfPropelBehavior::add('Campus', array('sfPropelUuidBehavior'));
开发者ID:sgrove,项目名称:cothinker,代码行数:26,代码来源:Campus.php

示例9: __toString

    public function __toString()
    {
        return $this->getProject() . ' : ' . $this->getTitle();
    }
    public function getUser()
    {
        return $this->getSfGuardUser();
    }
    public function getPositionTitle()
    {
        $position = $this->getProjectPosition();
        if ($position == null) {
            return "Dead Project";
        }
        return $position->getTitle();
    }
    public function getProjectTitle()
    {
        $position = $this->getProjectPosition();
        if ($position == null) {
            return "Dead Project";
        }
        $project = $position->getProject();
        if ($project == null) {
            return "Dead Project";
        }
        return $project->getTitle();
    }
}
sfPropelBehavior::add('ProjectUser', array('sfPropelUuidBehavior'));
开发者ID:sgrove,项目名称:cothinker,代码行数:30,代码来源:ProjectUser.php

示例10: getOther

        return false;
    }
    public function getOther($user_id)
    {
        if ($this->isMember($user_id)) {
            if ($this->getUser1Id() == $user_id) {
                return $this->getUser2Id();
            }
            return $this->getUser1Id();
        }
        return false;
    }
    public function getOtherUser($user_id)
    {
        $id = $this->getOther($user_id);
        if ($id != false) {
            return sfGuardUserPeer::retrieveByPk($id);
        } else {
            return false;
        }
    }
    public function isPending()
    {
        if ($this->getStatus() == sfConfig::get('app_socon_status_pending')) {
            return true;
        }
        return false;
    }
}
sfPropelBehavior::add('SocialConnection', array('sfPropelUuidBehavior'));
开发者ID:sgrove,项目名称:cothinker,代码行数:30,代码来源:SocialConnection.php

示例11: getThumbnail

    }
    public function getThumbnail($size = "small")
    {
        if ($this->isFilled()) {
            return $this->getUser()->getProfile()->getThumbnail($size);
        }
        $photo = "noprofile.png";
        if ($size == "tiny") {
            return '/' . sfConfig::get('sf_upload_dir_name') . '/thumbnails/tiny/' . $photo;
        }
        if ($size == "small") {
            return '/' . sfConfig::get('sf_upload_dir_name') . '/thumbnails/small/' . $photo;
        }
        if ($size == "medium") {
            return '/' . sfConfig::get('sf_upload_dir_name') . '/thumbnails/medium/' . $photo;
        }
        if ($size == "large") {
            return '/' . sfConfig::get('sf_upload_dir_name') . '/thumbnails/large/' . $photo;
        }
    }
    public function getMilestones($sort_by = "deadline", $direction = "asc")
    {
        return PositionMilestonePeer::retrieveSortedByPositionId($this->getId(), $sort_by, $direction);
    }
}
//sfPropelBehavior::add('ProjectPosition', array('versionable'));
sfPropelBehavior::add('ProjectPosition', array('sfPropelUuidBehavior'));
//sfPropelBehavior::add('ProjectPosition', array('paranoid' => array('column' => 'deleted_at')));
sfPropelBehavior::add('ProjectPosition', array('sfPropelActAsCountableBehavior'));
sfPropelBehavior::add('ProjectPosition', array('sfPropelActAsTaggableBehavior'));
开发者ID:sgrove,项目名称:cothinker,代码行数:30,代码来源:ProjectPosition.php

示例12: array

<?php

/**
 * Subclass for representing a row from the 'ct_application_field_entry' table.
 *
 * 
 *
 * @package lib.model
 */
class CoApplicationFieldEntry extends BaseCoApplicationFieldEntry
{
}
sfPropelBehavior::add('CoApplicationFieldEntry', array('sfPropelUuidBehavior'));
开发者ID:sgrove,项目名称:cothinker,代码行数:13,代码来源:CoApplicationFieldEntry.php

示例13: getSettings

        sfContext::getInstance()->getLogger()->info("Form created, setting assigned. ");
        return $form;
    }
    // Settings interfaces are still temporary, and not explicitely necessary
    public function getSettings()
    {
        return ProjectSettingPeer::retrieveByProjectId($this->getId());
    }
    public function getSetting($setting)
    {
        return ProjectSettingPeer::retrieveByProjectIdTitle($this->getId(), $setting);
    }
    public function setSetting($setting, $description = null)
    {
        $setting = ProjectSettingPeer::retrieveByProjectIdTitle($this->getId(), $setting);
        if ($setting == null) {
            $setting = new ProjectSetting();
            $setting->setProjectId($this->getId());
            $setting->setTitle($setting);
            $setting->setDescription($description);
            // Optional description of setting, if title is unclear
        }
        $setting->setSetting($setting);
        $setting->save();
    }
}
$xyz = array('from' => ProjectPeer::TITLE, 'to' => ProjectPeer::SLUG);
sfPropelBehavior::add('Project', array('sfPropelActAsSluggableBehavior' => array('columns' => $xyz, 'separator' => '_', 'permanent' => false)));
sfPropelBehavior::add('Project', array('sfPropelActAsCommentableBehavior'));
sfPropelBehavior::add('Project', array('sfPropelActAsStarredBehavior'));
开发者ID:sgrove,项目名称:cothinker,代码行数:30,代码来源:Project.php

示例14: setup

 /**
  * Sets up the provided model by adding propel behaviors.  It pulls the data to use for this
  * in the search.yml file.
  * @param string $model The model name to setup.
  */
 public function setup($model)
 {
     sfPropelBehavior::add($model, array('search' => array()));
     return $this;
 }
开发者ID:rande,项目名称:sfSolrPlugin,代码行数:10,代码来源:sfLucenePropelInitializer.class.php

示例15: getRelatedModel

 */
require_once sfConfig::get('sf_plugins_dir') . '/nahoWikiPlugin/lib/model/plugin/PluginnahoWikiRevision.php';
class nahoWikiRevision extends PluginnahoWikiRevision
{
    public function getRelatedModel()
    {
        $name = $this->getnahoWikiPage()->getName();
        list($prefix, $id) = explode("_", $name);
        switch ($prefix) {
            case 'atto':
                return 'OppAtto';
                break;
            case 'votazione':
                return 'OppVotazione';
                break;
            case 'emendamento':
                return 'OppEmendamento';
                break;
        }
    }
    public function getRelatedId()
    {
        $name = $this->getnahoWikiPage()->getName();
        list($prefix, $id) = explode("_", $name);
        return $id;
    }
}
# nel progetto Openparlamento, questa classe è anche
# generatore di notizie di community
sfPropelBehavior::add('nahoWikiRevision', array('deppPropelActAsCommunityNewsGeneratorBehavior' => array('rel_model_getter' => 'getRelatedModel', 'rel_id_getter' => 'getRelatedId')));
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:30,代码来源:nahoWikiRevision.php


注:本文中的sfPropelBehavior::add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。