Skip to content

Instantly share code, notes, and snippets.

(function() {
var callWithJQuery;
callWithJQuery = function(pivotModule) {
if (typeof exports === "object" && typeof module === "object") {
return pivotModule(require("jquery"), require("plotly.js"));
} else if (typeof define === "function" && define.amd) {
return define(["jquery", "plotly.js"], pivotModule);
} else {
return pivotModule(jQuery, Plotly);
<?php
function mit_qb_cron() {
if (variable_get('mit_qb_import_quickbase_during_cron', TRUE)) {
module_load_include('inc', 'mit_qb');
mit_qb_delete_and_reimport_quickbase();
}
}
function mit_gb_id_for_term($term_name,$vid)
{
$ret = NULL;
$query = new EntityFieldQuery;
$result = $query
->entityCondition('entity_type', 'taxonomy_term')
->propertyCondition('name', $term_name)
->propertyCondition('vid', $vid)
->execute();
public function configure()
{
parent::configure();
$this->test = $this->getOption('test');
$this->setWidget('administered_on', new sfWidgetFormInputHidden());
$questions = is_object($this->test) ? $this->test->getQuestionswithAnswers() : array();
$this->setWidget('client_id', new sfWidgetFormInputHidden());
$this->setWidget('instrument_id', new sfWidgetFormInputHidden());
foreach($questions as $question)
{
Center:
tableName: center
actAs: [ Versionable, Timestampable ]
columns:
name: { type: string(255), notnull: true, unique: true }
address1: string(30)
address2: string(30)
city: string(30)
state: string(2)
zip: string(12)
Center:
tableName: center
actAs: [ Versionable, Timestampable ]
columns:
name: { type: string(255), notnull: true, unique: true }
address1: string(30)
address2: string(30)
city: string(30)
state: string(2)
zip: string(12)
class sfGuardUserForm extends PluginsfGuardUserForm
{
public function configure()
{
$this->setWidgets(array(
'id' => new sfWidgetFormInputHidden(),
'first_name' => new sfWidgetFormInputText(),
'last_name' => new sfWidgetFormInputText(),
'email_address' => new sfWidgetFormInputText(),
'username' => new sfWidgetFormInputText(),
public function configure()
{
parent::configure();
$this->setWidgets(array(
'id' => new sfWidgetFormInputHidden(),
'center_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Center'), 'add_empty' => false)),
'sf_guard_user_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('sfGuardUser'), 'add_empty' => false)),
'role' => new sfWidgetFormInputText(),
'first_name' => new sfWidgetFormInputText(),
<?php
class myUser extends sfGuardSecurityUser
{
public function getCenter() {
return parent::getGuardUser()->getStaff()->getCenter() : null;
}
<?php
class StaffTable extends sfGuardUserTable
{
public static function getInstance()
{
return Doctrine_Core::getTable('Staff');
}