public static function checkUser2PropertyAccess($userid, $propertyid, $access) { $user2PropertyModel = new User2property(); $results = $user2PropertyModel->findAllByAttributes(array('userId' => $userid, 'propertyId' => $propertyid)); if (count($results) == 0) { return false; } if ($results[0]->getAttribute('access') <= $access) { return true; } return false; }
protected function getPropertyMembers() { $user2ProperyModel = new User2property(); $property_id = $this->propertyId; $resultsModels = $user2ProperyModel->findAllByAttributes(array('propertyId' => $property_id)); $results = array(); foreach ($resultsModels as $key => $resultModel) { if ($resultModel->getAttribute('access') <= UserAccessTable::BASIC_ACCESS && $resultModel->getAttribute('status') == UserAccessTable::STATUS_ACTIVE) { $results[$key] = $resultModel->getAttributes(); $results[$key]['user'] = $resultModel->user->getAttributes(); } } return $results; }