<?php

namespace SHServ\Entities;
use \SHServ\Containers\Registration\ProfilesContainer;

class Profile extends \SHServ\Middleware\Entity {
	public static $table_name = "profiles"; 
	protected static $fields = [
		"id", "uid", "first_name", "mid_name", "last_name", "userpic", "contacts", "update_at", "create_at"
	];

	public function __construct(Int $profile_id, Array $data = []) {
		parent::__construct(self::$table_name, $profile_id, $data);
	}	

	public function userpic_url(String $size): String {
		$userpic = $this -> userpic();
		return $userpic 
			? $userpic -> get_url($size) 
			: "/SHServ/Resources/img/default-avatar-img.png";
	}
}