Skip to content
This repository
Browse code

API Removed methods previously deprecated in 3.0

  • Loading branch information...
commit 644cc79ebb06a405101bd2d0521b82164fa77aff 1 parent aed58a5
Ingo Schommer authored December 14, 2012
11  docs/en/changelogs/3.1.0.md
Source Rendered
@@ -20,4 +20,13 @@
20 20
  * Deprecated global email methods `htmlEmail()` and `plaintextEmail`, as well as various email helper methods like `encodeMultipart()`. Use the `Email` API, or the `Mailer` class where applicable.
21 21
  * Removed non-functional `$inlineImages` option for sending emails 
22 22
  * Removed support for keyed arrays in `SelectionGroup`, use new `SelectionGroup_Item` object
23  
-   to populate the list instead (see [API docs](api:SelectionGroup)).
  23
+   to populate the list instead (see [API docs](api:SelectionGroup)).
  24
+ * Removed `Form->Name()`: Use getName()
  25
+ * Removed `FormField->setContainerFieldSet()`: Use setContainerFieldList()
  26
+ * Removed `FormField->rootFieldSet()`: Use rootFieldList()
  27
+ * Removed `Group::map()`: Use DataList::("Group")->map()
  28
+ * Removed `Member->generateAutologinHash()`: Tokens are no longer saved directly into the database in plaintext. Use the return value of the Member::generateAutologinTokenAndHash to get the token
  29
+ * Removed `Member->sendInfo()`: use Member_ChangePasswordEmail or Member_ForgotPasswordEmail directly
  30
+ * Removed `SQLMap::map()`: Use DataList::("Member")->map()
  31
+ * Removed `SQLMap::mapInGroups()`: Use Member::map_in_groups()
  32
+ * Removed `PasswordEncryptor::register()/unregister()`: Use config system instead
8  forms/Form.php
@@ -865,14 +865,6 @@ public function setController($controller) {
865 865
 	}
866 866
 
867 867
 	/**
868  
-	 * @return string
869  
-	 */
870  
-	public function Name() {
871  
-		Deprecation::notice('3.0', 'Use getName() instead.');
872  
-		return $this->getName();
873  
-	}
874  
-
875  
-	/**
876 868
 	 * Get the name of the form.
877 869
 	 * @return string
878 870
 	 */
10  forms/FormField.php
@@ -814,11 +814,6 @@ public function Required() {
814 814
 		}
815 815
 	}
816 816
 
817  
-	public function setContainerFieldSet($list) {
818  
-		Deprecation::notice('3.0', 'Use setContainerFieldList() instead.');
819  
-		return $this->setContainerFieldList($list);
820  
-	}
821  
-
822 817
 	/**
823 818
 	 * Set the FieldList that contains this field.
824 819
 	 *
@@ -830,11 +825,6 @@ public function setContainerFieldList($list) {
830 825
 		return $this;
831 826
 	}
832 827
 
833  
-	public function rootFieldSet() {
834  
-		Deprecation::notice('3.0', 'Use rootFieldList() instead.');
835  
-		return $this->rootFieldList();
836  
-	}
837  
-
838 828
 	public function rootFieldList() {
839 829
 		if(is_object($this->containerFieldList)) return $this->containerFieldList->rootFieldList();
840 830
 		else user_error("rootFieldList() called on $this->class object without a containerFieldList", E_USER_ERROR);
11  security/Group.php
@@ -251,18 +251,7 @@ public function Members($filter = "", $sort = "", $join = "", $limit = "") {
251 251
 	public function DirectMembers() {
252 252
 		return $this->getManyManyComponents('Members');
253 253
 	}
254  
-	
255  
-	public static function map($filter = "", $sort = "", $blank="") {
256  
-		Deprecation::notice('3.0', 'Use DataList::("Group")->map()');
257  
-
258  
-		$list = Group::get()->where($filter)->sort($sort);
259  
-		$map = $list->map();
260  
-
261  
-		if($blank) $map->unshift(0, $blank);
262 254
 		
263  
-		return $map;
264  
-	}
265  
-	
266 255
 	/**
267 256
 	 * Return a set of this record's "family" of IDs - the IDs of
268 257
 	 * this record and all its descendants.
82  security/Member.php
@@ -473,23 +473,6 @@ public function generateAutologinTokenAndStoreHash($lifetime = 2) {
473 473
 	}
474 474
 
475 475
 	/**
476  
-	 * @deprecated 3.0
477  
-	 */
478  
-	public function generateAutologinHash($lifetime = 2) {
479  
-		Deprecation::notice('3.0', 
480  
-			'Member::generateAutologinHash is deprecated - tokens are no longer saved directly into the database '.
481  
-			'in plaintext. Use the return value of the Member::generateAutologinTokenAndHash to get the token '.
482  
-			'instead.',
483  
-			Deprecation::SCOPE_METHOD);
484  
-
485  
-		user_error(
486  
-			'Member::generateAutologinHash is deprecated - tokens are no longer saved directly into the database '.
487  
-			'in plaintext. Use the return value of the Member::generateAutologinTokenAndHash to get the token '.
488  
-			'instead.', 
489  
-			E_USER_ERROR);
490  
-	}
491  
-
492  
-	/**
493 476
 	 * Check the token against the member.
494 477
 	 *
495 478
 	 * @param string $autologinToken
@@ -527,35 +510,6 @@ public static function member_from_autologinhash($RAW_hash, $login = false) {
527 510
 	}
528 511
 
529 512
 	/**
530  
-	 * Send signup, change password or forgot password informations to an user
531  
-	 *
532  
-	 * @param string $type Information type to send ("signup", "changePassword" or "forgotPassword")
533  
-	 * @param array $data Additional data to pass to the email (can be used in the template)
534  
-	 */
535  
-	public function sendInfo($type = 'signup', $data = null) {
536  
-		Deprecation::notice('3.0',
537  
-			'Please use Member_ChangePasswordEmail or Member_ForgotPasswordEmail directly instead');
538  
-
539  
-		switch($type) {
540  
-			case "changePassword":
541  
-				$e = Member_ChangePasswordEmail::create();
542  
-				break;
543  
-			case "forgotPassword":
544  
-				$e = Member_ForgotPasswordEmail::create();
545  
-				break;
546  
-		}
547  
-
548  
-		if(is_array($data)) {
549  
-			foreach($data as $key => $value)
550  
-				$e->$key = $value;
551  
-		}
552  
-
553  
-		$e->populateTemplate($this);
554  
-		$e->setTo($this->Email);
555  
-		$e->send();
556  
-	}
557  
-
558  
-	/**
559 513
 	 * Returns the fields for the member form - used in the registration/profile module.
560 514
 	 * It should return fields that are editable by the admin and the logged-in user. 
561 515
 	 *
@@ -1010,42 +964,6 @@ public function Groups() {
1010 964
 	public function DirectGroups() {
1011 965
 		return $this->getManyManyComponents('Groups');
1012 966
 	}
1013  
-
1014  
-
1015  
-	/**
1016  
-	 * Get member SQLMap
1017  
-	 *
1018  
-	 * @param string $filter Filter for the SQL statement (WHERE clause)
1019  
-	 * @param string $sort Sorting function (ORDER clause)
1020  
-	 * @param string $blank Shift a blank member in the items
1021  
-	 * @return SQLMap Returns an SQLMap that returns all Member data.
1022  
-	 *
1023  
-	 * @todo Improve documentation of this function! (Markus)
1024  
-	 */
1025  
-	public static function map($filter = "", $sort = "", $blank="") {
1026  
-		Deprecation::notice('3.0', 'Use DataList::("Member")->map()');
1027  
-
1028  
-		$list = Member::get()->where($filter)->sort($sort);
1029  
-		$map = $list->map();
1030  
-		
1031  
-		if($blank) $map->unshift(0, $blank);
1032  
-
1033  
-		return $map;
1034  
-	}
1035  
-
1036  
-	/**
1037  
-	 * Get a member SQLMap of members in specific groups
1038  
-	 * 
1039  
-	 * If no $groups is passed, all members will be returned
1040  
-	 * 
1041  
-	 * @param mixed $groups - takes a SS_List, an array or a single Group.ID
1042  
-	 * @return SQLMap Returns an SQLMap that returns all Member data.
1043  
-	 * @see map()
1044  
-	 */
1045  
-	public static function mapInGroups($groups = null) {
1046  
-		Deprecation::notice('3.0', 'Use Member::map_in_groups() instead');
1047  
-		return self::map_in_groups();
1048  
-	}
1049 967
 	
1050 968
 	/**
1051 969
 	 * Get a member SQLMap of members in specific groups
23  security/PasswordEncryptor.php
@@ -26,29 +26,6 @@ public static function get_encryptors() {
26 26
 	}
27 27
 	
28 28
 	/**
29  
-	 * Add a new encryptor implementation.
30  
-	 * 
31  
-	 * Note: Due to portability concerns, its not advisable to 
32  
-	 * override an existing $code mapping with different behaviour.
33  
-	 * 
34  
-	 * @param String $code This value will be stored stored in the 
35  
-	 * 	{@link Member->PasswordEncryption} property.
36  
-	 * @param String $class Classname of a {@link PasswordEncryptor} subclass
37  
-	 */
38  
-	public static function register($code, $class) {
39  
-		Deprecation::notice('3.0', 'Use the Config system to register Password encryptors');
40  
-		self::$encryptors[$code] = $class;
41  
-	}
42  
-	
43  
-	/**
44  
-	 * @param String $code Unique lookup.
45  
-	 */
46  
-	public static function unregister($code) {
47  
-		Deprecation::notice('3.0', 'Use the Config system to unregister Password encryptors');
48  
-		if(isset(self::$encryptors[$code])) unset(self::$encryptors[$code]);
49  
-	}
50  
-	
51  
-	/**
52 29
 	 * @param String $algorithm
53 30
 	 * @return PasswordEncryptor
54 31
 	 * @throws PasswordEncryptor_NotFoundException
24  tests/security/GroupTest.php
@@ -25,30 +25,6 @@ public function testGroupCodeDefaultsToTitle() {
25 25
 		$this->assertNull($g3->Code, 'Default title doesnt trigger attribute setting');
26 26
 	}
27 27
 	
28  
-	/**
29  
-	 * Test the Group::map() function
30  
-	 */
31  
-	public function testGroupMap() {
32  
-		// 2.4 only
33  
-		$originalDeprecation = Deprecation::dump_settings();
34  
-		Deprecation::notification_version('2.4');
35  
-		
36  
-		/* Group::map() returns an SQLMap object implementing iterator.  You can use foreach to get ID-Title pairs. */
37  
-		
38  
-		// We will iterate over the map and build mapOuput to more easily call assertions on the result.
39  
-		$map = Group::map();
40  
-		$mapOutput = $map->toArray();
41  
-		
42  
-		$group1 = $this->objFromFixture('Group', 'group1');
43  
-		$group2 = $this->objFromFixture('Group', 'group2');
44  
-
45  
-		/* We have added 2 groups to our fixture.  They should both appear in $mapOutput. */
46  
-		$this->assertEquals($mapOutput[$group1->ID], $group1->Title);
47  
-		$this->assertEquals($mapOutput[$group2->ID], $group2->Title);
48  
-
49  
-		Deprecation::restore_settings($originalDeprecation);
50  
-	}
51  
-	
52 28
 	public function testMemberGroupRelationForm() {
53 29
 		Session::set('loggedInAs', $this->idFromFixture('GroupTest_Member', 'admin'));
54 30
 		

0 notes on commit 644cc79

Please sign in to comment.
Something went wrong with that request. Please try again.