Skip to content

Commit

Permalink
Fix misc. Subsite docblocks, remove DataObject::get_by_id call.
Browse files Browse the repository at this point in the history
  • Loading branch information
Garion Herman committed Jun 4, 2017
1 parent 49fbfcb commit c248436
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions code/model/Subsite.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use SilverStripe\ORM\DataList;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\DB;
use SilverStripe\ORM\SS_List;
use SilverStripe\Security\Group;
use SilverStripe\Security\Member;
use SilverStripe\Security\Permission;
Expand Down Expand Up @@ -127,11 +128,11 @@ public static function set_allowed_themes($themes)
* Gets the subsite currently set in the session.
*
* @uses ControllerSubsites->controllerAugmentInit()
* @return Subsite
* @return DataObject The current Subsite
*/
public static function currentSubsite()
{// get_by_id handles caching so we don't have to
return DataObject::get_by_id(Subsite::class, self::currentSubsiteID());
{
return Subsite::get()->byID(self::currentSubsiteID());
}

/**
Expand Down Expand Up @@ -202,7 +203,7 @@ public static function changeSubsite($subsite)
* for example matching all subdomains on *.example.com with one subsite,
* and all subdomains on *.example.org on another.
*
* @param $host The host to find the subsite for. If not specified, $_SERVER['HTTP_HOST'] is used.
* @param $host string The host to find the subsite for. If not specified, $_SERVER['HTTP_HOST'] is used.
* @param bool $checkPermissions
* @return int Subsite ID
*/
Expand Down Expand Up @@ -367,11 +368,10 @@ public static function all_accessible_sites($includeMainSite = true, $mainSiteTi
* Sites will only be included if they have a Title.
*
* @param $permCode array|string Either a single permission code or an array of permission codes.
* @param bool|If $includeMainSite If true, the main site will be included if appropriate.
* @param The|string $mainSiteTitle The label to give to the main site
* @param $member
* @return DataList of <a href='psi_element://Subsite'>Subsite</a> instances
* instances
* @param $includeMainSite bool If true, the main site will be included if appropriate.
* @param $mainSiteTitle string The label to give to the main site
* @param $member int|Member The member attempting to access the sites
* @return DataList|ArrayList of {@link Subsite} instances
*/
public static function accessible_sites(
$permCode,
Expand Down Expand Up @@ -777,7 +777,7 @@ public function getLanguage()

/**
*
* @return ValidationResult
* @return \SilverStripe\ORM\ValidationResult
*/
public function validate()
{
Expand Down

0 comments on commit c248436

Please sign in to comment.