mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-10 01:47:03 +03:00
v1.3.1.444
This commit is contained in:
parent
b0cf81c3f7
commit
45ca5e33ca
401 changed files with 47 additions and 46 deletions
|
|
@ -0,0 +1,111 @@
|
|||
<?php
|
||||
|
||||
namespace RainLoop\Providers\Contacts\Classes;
|
||||
|
||||
class Contact
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $IdContact;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $IdUser;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $Type;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $Frec;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $ListName;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $Name;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $Emails;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $ImageHash;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $Data;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->Clear();
|
||||
}
|
||||
|
||||
public function Clear()
|
||||
{
|
||||
$this->IdContact = 0;
|
||||
$this->IdUser = 0;
|
||||
$this->Type = 0;
|
||||
$this->Frec = 0;
|
||||
$this->ListName = '';
|
||||
$this->Name = '';
|
||||
$this->ImageHash = '';
|
||||
$this->Emails = array();
|
||||
$this->Data = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function GenarateListName()
|
||||
{
|
||||
return 0 < \strlen($this->Name) ? $this->Name : (!empty($this->Emails[0]) ? $this->Emails[0] : '');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function EmailsAsString()
|
||||
{
|
||||
return \trim(\implode(' ', $this->Emails));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function DataAsString()
|
||||
{
|
||||
return @\serialize($this->Data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sData
|
||||
*/
|
||||
public function ParseData($sData)
|
||||
{
|
||||
$sData = (string) $sData;
|
||||
$sData = \trim($sData);
|
||||
|
||||
if (!empty($sData))
|
||||
{
|
||||
$aData = @\unserialize($sData);
|
||||
if (\is_array($aData))
|
||||
{
|
||||
$this->Data = $aData;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
namespace RainLoop\Providers\Contacts\Classes;
|
||||
|
||||
class Db
|
||||
{
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
static public function Version()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
static public function Strucure()
|
||||
{
|
||||
return array(
|
||||
'rlContactsUsers' => array(
|
||||
'IdUser' => 'INTEGER PRIMARY KEY',
|
||||
'Email' => 'TEXT'
|
||||
),
|
||||
'rlContactsItems' => array(
|
||||
'IdContact' => 'INTEGER PRIMARY KEY',
|
||||
'IdUser' => 'INTEGER',
|
||||
'Type' => 'INTEGER',
|
||||
'Frec' => 'INTEGER',
|
||||
'ImageHash' => 'TEXT',
|
||||
'ListName' => 'TEXT',
|
||||
'Name' => 'TEXT',
|
||||
'Emails' => 'TEXT',
|
||||
'Data' => 'TEXT'
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue