Elgg  Version master
GroupHelpers.php
Go to the documentation of this file.
1 <?php
2 
4 
11 trait GroupHelpers {
12 
13  private $visibility = [
17  ];
18 
19  private $content_access_modes = [
22  ];
23 
24  private $membership = [
27  ];
28 
33  public function getRandomGroupVisibility() {
34  $key = array_rand($this->visibility, 1);
35 
36  return $this->visibility[$key];
37  }
38 
43  public function getRandomGroupContentAccessMode() {
44  $key = array_rand($this->content_access_modes, 1);
45 
46  return $this->content_access_modes[$key];
47  }
48 
53  public function getRandomGroupMembership() {
54  $key = array_rand($this->membership, 1);
55 
56  return $this->membership[$key];
57  }
58 }
getRandomGroupVisibility()
Returns random visibility value.
getRandomGroupContentAccessMode()
Returns random content access mode value.
const ACCESS_PRIVATE
Definition: constants.php:10
trait GroupHelpers
Group helpers for seeding.
const ACCESS_LOGGED_IN
Definition: constants.php:11
const CONTENT_ACCESS_MODE_UNRESTRICTED
Definition: ElggGroup.php:16
const CONTENT_ACCESS_MODE_MEMBERS_ONLY
Definition: ElggGroup.php:17
if($container instanceof ElggGroup &&$container->guid!=elgg_get_page_owner_guid()) $key
Definition: summary.php:44
const ACCESS_PUBLIC
Definition: constants.php:12
getRandomGroupMembership()
Returns random membership mode.