/** * @see sfPluginConfiguration */ public function initialize() { $this->dispatcher->connect('component.method_not_found', array('ckComponentEventListener', 'listenToComponentMethodNotFoundEvent')); spl_autoload_register(array(new ckGenericObjectAdapterFactory(sfConfig::get('sf_cache_dir')), 'autoload')); ckObjectWrapper::addObjectWrapper(new ckDefaultObjectWrapper()); ckObjectWrapper::addObjectWrapper(new ckGenericObjectAdapterWrapper()); ckObjectWrapper::addObjectWrapper(new ckArrayObjectWrapper()); ckObjectWrapper::addObjectWrapper(new ckDoctrineRecordWrapper()); }
/** * Executes this filter. * * @param sfFilterChain $filterChain A sfFilterChain instance */ public function execute($filterChain) { if ($this->isFirstCall()) { $context = $this->getContext(); $request = $context->getRequest(); // get parameters from request $param = $request->getParameter(self::PARAMETER_KEY, null); // get parameter map from module config $map = sfConfig::get(sprintf('mod_%s_%s_parameter', strtolower($context->getModuleName()), $context->getActionName())); if (is_array($param) && is_array($map)) { // map parameters to the names stored in the map for ($i = 0, $count = count($map); $i < $count; $i++) { if ($param[$i] === '') { $param[$i] = null; } $request->setParameter($map[$i], ckObjectWrapper::unwrap($param[$i])); } } if (sfConfig::get('sf_logging_enabled')) { $context->getEventDispatcher()->notify(new sfEvent($this, 'application.log', array('Mapped soap parameters to request parameters.'))); } } $filterChain->execute(); }
/** * Sets the given property of the managed object to the given value through its property strategy. * The value is unwrapped from a SOAP-processable type using ckObjectWrapper::unwrap(). * * @param string $property The property to set * @param mixed $value The new value */ public function __set($property, $value) { $this->getPropertyStrategy()->setPropertyValue($this->getObject(), $property, ckObjectWrapper::unwrap($value)); }
{ $this->_parent = $parent; } } $test = new lime_test(null, new lime_output_color()); $test->is(ckObjectWrapper::wrap(null), null); $test->is(ckObjectWrapper::unwrap(null), null); $test->is(ckObjectWrapper::wrap(10), 10); $test->is(ckObjectWrapper::unwrap(10), 10); $test->is(ckObjectWrapper::wrap('str'), 'str'); $test->is(ckObjectWrapper::unwrap('str'), 'str'); $std = new StdObject('testData'); $wrappedStd = ckObjectWrapper::wrap($std); $test->isa_ok($wrappedStd, 'ckGenericObjectAdapter'); $test->is($wrappedStd->getObject(), $std); $test->is(ckObjectWrapper::unwrap($wrappedStd), $std); $wrappedWrappedStd = ckObjectWrapper::wrap($wrappedStd); $test->isa_ok($wrappedWrappedStd, 'ckGenericObjectAdapter'); $test->is($wrappedWrappedStd, $wrappedStd); $test->is($wrappedWrappedStd->getObject(), $std); $tbRoot = new TreeBeanObject(null); $tbRoot->setParent($tbRoot); $tbChild1 = new TreeBeanObject($tbRoot); $tbChild2 = new TreeBeanObject($tbChild1); $wrappedTbChild2 = ckObjectWrapper::wrap($tbChild2); $test->isa_ok($wrappedTbChild2, 'ckGenericObjectAdapter'); $test->isa_ok($wrappedTbChild2->parent, 'ckGenericObjectAdapter'); $test->isa_ok($wrappedTbChild2->parent->parent, 'ckGenericObjectAdapter'); $wrappedTbRoot = $wrappedTbChild2->parent->parent; $test->is($wrappedTbRoot->parent->getObject(), $wrappedTbRoot->getObject()); $test->is($wrappedTbRoot->parent, $wrappedTbRoot);
/** * (non-PHPdoc) * @see lib/adapter/ckAbstractResultAdapter#getResult() */ public function getResult(sfAction $action) { return ckObjectWrapper::wrap($this->doGetResult($action)); }