|
|
|
|
@ -1176,36 +1176,6 @@ class Course |
|
|
|
|
return $this; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Check if the course has a picture. |
|
|
|
|
* |
|
|
|
|
* @return bool |
|
|
|
|
*/ |
|
|
|
|
public function hasPicture() |
|
|
|
|
{ |
|
|
|
|
return file_exists(api_get_path(SYS_COURSE_PATH).$this->directory.'/course-pic85x85.png'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Get the course picture path. |
|
|
|
|
* |
|
|
|
|
* @param bool $fullSize |
|
|
|
|
* |
|
|
|
|
* @return null|string |
|
|
|
|
*/ |
|
|
|
|
public function getPicturePath($fullSize = false) |
|
|
|
|
{ |
|
|
|
|
if (!$this->hasPicture()) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($fullSize) { |
|
|
|
|
return api_get_path(WEB_COURSE_PATH).$this->directory.'/course-pic.png'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return api_get_path(WEB_COURSE_PATH).$this->directory.'/course-pic85x85.png'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @param CourseRelUser $subscription |
|
|
|
|
* |
|
|
|
|
@ -1215,11 +1185,11 @@ class Course |
|
|
|
|
{ |
|
|
|
|
if ($this->getUsers()->count()) { |
|
|
|
|
$criteria = Criteria::create()->where( |
|
|
|
|
Criteria::expr()->eq("user", $subscription->getUser()) |
|
|
|
|
Criteria::expr()->eq('user', $subscription->getUser()) |
|
|
|
|
)->andWhere( |
|
|
|
|
Criteria::expr()->eq("status", $subscription->getStatus()) |
|
|
|
|
Criteria::expr()->eq('status', $subscription->getStatus()) |
|
|
|
|
)->andWhere( |
|
|
|
|
Criteria::expr()->eq("relationType", $subscription->getRelationType()) |
|
|
|
|
Criteria::expr()->eq('relationType', $subscription->getRelationType()) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
$relation = $this->getUsers()->matching($criteria); |
|
|
|
|
|