NodeAccessRecordFactory.php in Permissions by Term 8.2
Same filename and directory in other branches
Namespace
Drupal\permissions_by_term\FactoryFile
src/Factory/NodeAccessRecordFactory.phpView source
<?php
namespace Drupal\permissions_by_term\Factory;
use Drupal\permissions_by_term\Model\NodeAccessRecordModel;
class NodeAccessRecordFactory {
public function create($realm, $gid, $nid, $langcode = '', $grantUpdate, $grantDelete) {
$langcode = $langcode === '' ? \Drupal::languageManager()
->getCurrentLanguage()
->getId() : $langcode;
$nodeAccessRecord = new NodeAccessRecordModel();
$nodeAccessRecord
->setNid($nid);
$nodeAccessRecord
->setFallback(1);
$nodeAccessRecord
->setGid($gid);
$nodeAccessRecord
->setGrantDelete($grantDelete);
$nodeAccessRecord
->setGrantUpdate($grantUpdate);
$nodeAccessRecord
->setGrantView(1);
$nodeAccessRecord
->setLangcode($langcode);
$nodeAccessRecord
->setRealm($realm);
return $nodeAccessRecord;
}
}
Classes
Name | Description |
---|---|
NodeAccessRecordFactory |