/**
  * THIS IS NOT PART OF THE STORMPATH PUBLIC API.  SDK end-users should not call it - it could be removed or
  * changed at any time.  It has the public modifier only as an implementation technique to be accessible to other
  * resource implementations.
  *
  * @param $account the account to associate with the group.
  * @param $group the group which will contain the account.
  * @param $dataStore the datastore used to create the membership.
  * @param $options the options to pass to the group membership creation.
  * @return the created GroupMembership instance.
  */
 public static function _create(Account $account, Group $group, InternalDataStore $dataStore, array $options = array())
 {
     //TODO: enable auto discovery
     $href = '/' . self::PATH;
     $groupMembership = $dataStore->instantiate(Stormpath::GROUP_MEMBERSHIP);
     $groupMembership->setResourceProperty(self::ACCOUNT, $account);
     $groupMembership->setResourceProperty(self::GROUP, $group);
     return $dataStore->create($href, $groupMembership, Stormpath::GROUP_MEMBERSHIP, $options);
 }
 /**
  * THIS IS NOT PART OF THE STORMPATH PUBLIC API.  SDK end-users should not call it - it could be removed or
  * changed at any time.  It has the public modifier only as an implementation technique to be accessible to other
  * resource implementations.
  *
  * @param $accountStoreMapping the account store mapping to create.
  * @param $application the application to associate with the account store mapping.
  * @param $dataStore the data store used to create the account store mapping.
  * @param $options the options to pass to the group mapping creation.
  * @return the created AccountStoreMapping instance.
  */
 public static function _create(AccountStoreMapping $accountStoreMapping, Application $application, InternalDataStore $dataStore, array $options = array())
 {
     //TODO: enable auto discovery
     $href = "/" . self::PATH;
     // properly setting the resource properties
     $accountStoreMapping->setResourceProperty(self::APPLICATION, $application);
     $accountStoreMapping->accountStore = $accountStoreMapping->accountStore;
     return $dataStore->create($href, $accountStoreMapping, Stormpath::ACCOUNT_STORE_MAPPING, $options);
 }