Skip to content

Commit

Permalink
(Fixed issue 2951) Removed CConfiguration::createObject, CController:…
Browse files Browse the repository at this point in the history
…:paginate and CHtml::getActiveId deprecated since 1.0.x
  • Loading branch information
alexander.makarow committed Nov 21, 2011
1 parent 6b21f0f commit 3e085ed
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 60 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -20,6 +20,7 @@ Version 1.1.9 work in progress
- Chg: Upgraded jQuery to 1.7 (Sam Dark,mdomba)
- Chg: Reverted back the changes made to fix issue 2284 (Qiang)
- Chg #2647: Fixed inconvenient way of defining through relation (creocoder, Sam Dark)
- Chg #2951: Removed CConfiguration::createObject, CController::paginate and CHtml::getActiveId deprecated since 1.0.x (Sam Dark)
- Enh #2029: Added scope support to Model::relations() (creocoder, Sam Dark)
- Enh #2334: CHttpRequest::getPathInfo() now properly decodes both UTF-8 and ISO-8859-1 encoded URIs (Sam Dark)
- Enh #2387: Numeric keys are now displayed in error/exception stacktrace call argument if array isn't 0..X indexed (Sam Dark)
Expand Down
3 changes: 3 additions & 0 deletions UPGRADE
Expand Up @@ -21,6 +21,9 @@ General upgrade intructions

Upgrading from v1.1.8
---------------------
- CConfiguration::createObject, CController::paginate and CHtml::getActiveId deprecated since 1.0.x were removed. Use
Yii::createComponent, new CPagination directly and CHtml::activeId respectively.

- In CErrorHandler::handleException() the checking for ajax call has been removed
as it was preventing to customize the display of the exception during an ajax call.

Expand Down
17 changes: 0 additions & 17 deletions framework/collections/CConfiguration.php
Expand Up @@ -98,21 +98,4 @@ public function applyTo($object)
foreach($this->toArray() as $key=>$value)
$object->$key=$value;
}

/**
* Creates an object and initializes it based on the given configuration.
*
* NOTE: this method has been deprecated since version 1.0.1.
* Please use {@link YiiBase::createComponent Yii::createComponent}, instead.
*
* @param mixed $config the configuration. It can be either a string or an array.
* @return mixed the created object
* @throws CException if the configuration does not have 'class' value
*/
public static function createObject($config)
{
if($config instanceof self)
$config=$config->toArray();
return Yii::createComponent($config);
}
}
24 changes: 0 additions & 24 deletions framework/web/CController.php
Expand Up @@ -1156,30 +1156,6 @@ public function filterAccessControl($filterChain)
$filter->filter($filterChain);
}

/**
* Generates pagination information.
* This method can be used to generate pagination information given item count
* and page size. The pagination information can then be passed to {@link CBasePager pagers}
* for corresponding rendering.
*
* Note: this method has been deprecated since version 1.0.1.
* You should directly use "new CPagination" to create a pagination object.
*
* @param integer $itemCount the total item count
* @param integer $pageSize the page size. See {@link CPagination} for default value.
* @param string $pageVar the name of the GET variable storing the current page index. See {@link CPagination} for default value.
* @return CPagination the pagination information
*/
public function paginate($itemCount,$pageSize=null,$pageVar=null)
{
$pages=new CPagination($itemCount);
if($pageSize!==null)
$pages->pageSize=$pageSize;
if($pageVar!==null)
$pages->pageVar=$pageVar;
return $pages;
}

/**
* Returns a persistent page state value.
* A page state is a variable that is persistent across POST requests of the same page.
Expand Down
13 changes: 0 additions & 13 deletions framework/web/helpers/CHtml.php
Expand Up @@ -1558,19 +1558,6 @@ public static function activeRadioButtonList($model,$attribute,$data,$htmlOption
return $hidden . self::radioButtonList($name,$selection,$data,$htmlOptions);
}

/**
* Returns the element ID that is used by methods such as {@link activeTextField}.
* This method has been deprecated since version 1.0.5. Please use {@link activeId} instead.
* @param CModel $model the data model
* @param string $attribute the attribute
* @return string the element ID for the active field corresponding to the specified model and attribute.
* @deprecated 1.0.5
*/
public static function getActiveId($model,$attribute)
{
return self::activeId($model,$attribute);
}

/**
* Displays a summary of validation errors for one or several models.
* @param mixed $model the models whose input errors are to be displayed. This can be either
Expand Down
6 changes: 0 additions & 6 deletions tests/framework/collections/CConfigurationTest.php
Expand Up @@ -88,10 +88,4 @@ public function testCreateComponent()
$this->assertEquals(get_class($obj),'MyClass');
$this->assertEquals($obj->param2,3);
}

public function testCreateObject(){
$obj = CConfiguration::createObject(array('class'=>'MyClass','param2'=>3));
$this->assertEquals(get_class($obj),'MyClass');
$this->assertEquals($obj->param2,3);
}
}

0 comments on commit 3e085ed

Please sign in to comment.