Esempio n. 1
0
 public function testGettersSetters()
 {
     $this->model->setEntityClass(self::ENTITY_CLASS);
     $this->assertEquals(self::ENTITY_CLASS, $this->model->getEntityClass());
     $this->model->setEntityId(self::ENTITY_ID);
     $this->assertEquals(self::ENTITY_ID, $this->model->getEntityId());
     $businessUnits = [2];
     $this->model->setEntities($businessUnits);
     $this->assertEquals($businessUnits, $this->model->getEntities());
 }
Esempio n. 2
0
 /**
  * Generate SIDs from entities
  *
  * @param Share $model
  *
  * @return array
  */
 protected function generateSids(Share $model)
 {
     $newSids = [];
     foreach ($model->getEntities() as $entity) {
         if ($entity instanceof User) {
             $newSids[] = UserSecurityIdentity::fromAccount($entity);
         } elseif ($entity instanceof BusinessUnit) {
             $newSids[] = BusinessUnitSecurityIdentity::fromBusinessUnit($entity);
         }
     }
     return $newSids;
 }