/** * Publishes and registers all necessary script files. */ protected function registerScripts() { parent::registerScripts(); $basePath = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR; $baseUrl = Yii::app()->getAssetManager()->publish($basePath, false, 1, YII_DEBUG); Yii::app()->clientScript->registerScriptFile($baseUrl . '/g.pie-min.js'); }
public function delete(Doctrine_Connection $conn = null) { parent::delete($conn); $path = $this->getChartPath('system'); if (file_exists($path)) { $fs = new sfFilesystem(new sfEventDispatcher()); $fs->remove($path); } }
/** * Returns a peer instance associated with this om. * * Since Peer classes are not to have any instance attributes, this method returns the * same instance for all member of this class. The method could therefore * be static, but this would prevent one from overriding the behavior. * * @return ChartPeer */ public function getPeer() { if (self::$peer === null) { self::$peer = new ChartPeer(); } return self::$peer; }
/** * returns the chart meta data */ public function getMetadata($key = null) { $default = Chart::defaultMetaData(); $meta = json_decode(parent::getMetadata(), true); if (!is_array($meta)) { $meta = array(); } $meta = array_merge_recursive_simple($default, $meta); if (empty($key)) { return $meta; } $keys = explode('.', $key); $p = $meta; foreach ($keys as $key) { $p = $p[$key]; } return $p; }