Created AccountImageSettings object

This commit is contained in:
Pierre 2018-04-29 13:59:54 +02:00
parent fa5fd02c18
commit 4dc56a3dde

View File

@ -0,0 +1,56 @@
<?php
/**
* Account Image settings
*
* @author Pierre HUBERT
*/
class AccountImageSettings {
/**
* Visibility : open
*
* Everyone
*/
const VISIBILITY_OPEN = 3;
/**
* Visibility : public
*
* Any signed in personn
*/
const VISIBILITY_PUBLIC = 2;
/**
* Visibility : private
*
* Only for the personns and its friends
*/
const VISIBILITY_FRIENDS = 1;
//Private fields
private $visibility = self::VISIBILITY_OPEN;
private $path;
//Set and get visibility level
public function set_visibility_level(int $visibility_level){
$this->visibility_level = $visibility_level;
}
public function get_visibility_level() : int {
return $this->visibility_level;
}
//Set and get account image path
public function set_image_path(string $image_path){
$this->image_path = $image_path == "" ? null : $image_path;
}
public function has_image_path() : bool {
return $this->image_path != null;
}
public function get_image_path() : string {
return $this->image_path != null ? $this->image_path : "null";
}
}