set intro::duplex deprecated because of no usage
This commit is contained in:
parent
d67b676ce5
commit
f5786a8f4f
7 changed files with 5 additions and 18 deletions
|
@ -715,7 +715,7 @@ CREATE TABLE IF NOT EXISTS `intro` (
|
||||||
`contact-id` int unsigned NOT NULL DEFAULT 0 COMMENT '',
|
`contact-id` int unsigned NOT NULL DEFAULT 0 COMMENT '',
|
||||||
`suggest-cid` int unsigned COMMENT 'Suggested contact',
|
`suggest-cid` int unsigned COMMENT 'Suggested contact',
|
||||||
`knowyou` boolean NOT NULL DEFAULT '0' COMMENT '',
|
`knowyou` boolean NOT NULL DEFAULT '0' COMMENT '',
|
||||||
`duplex` boolean NOT NULL DEFAULT '0' COMMENT '',
|
`duplex` boolean NOT NULL DEFAULT '0' COMMENT 'deprecated',
|
||||||
`note` text COMMENT '',
|
`note` text COMMENT '',
|
||||||
`hash` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`hash` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`datetime` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
|
`datetime` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
|
||||||
|
|
|
@ -14,7 +14,7 @@ Fields
|
||||||
| contact-id | | int unsigned | NO | | 0 | |
|
| contact-id | | int unsigned | NO | | 0 | |
|
||||||
| suggest-cid | Suggested contact | int unsigned | YES | | NULL | |
|
| suggest-cid | Suggested contact | int unsigned | YES | | NULL | |
|
||||||
| knowyou | | boolean | NO | | 0 | |
|
| knowyou | | boolean | NO | | 0 | |
|
||||||
| duplex | | boolean | NO | | 0 | |
|
| duplex | deprecated | boolean | NO | | 0 | |
|
||||||
| note | | text | YES | | NULL | |
|
| note | | text | YES | | NULL | |
|
||||||
| hash | | varchar(255) | NO | | | |
|
| hash | | varchar(255) | NO | | | |
|
||||||
| datetime | | datetime | NO | | 0001-01-01 00:00:00 | |
|
| datetime | | datetime | NO | | 0001-01-01 00:00:00 | |
|
||||||
|
|
|
@ -71,7 +71,6 @@ class Introduction extends BaseDepository
|
||||||
'contact-id' => $introduction->cid,
|
'contact-id' => $introduction->cid,
|
||||||
'suggest-cid' => $introduction->sid,
|
'suggest-cid' => $introduction->sid,
|
||||||
'knowyou' => $introduction->knowyou ? 1 : 0,
|
'knowyou' => $introduction->knowyou ? 1 : 0,
|
||||||
'duplex' => $introduction->duplex ? 1 : 0,
|
|
||||||
'note' => $introduction->note,
|
'note' => $introduction->note,
|
||||||
'hash' => $introduction->hash,
|
'hash' => $introduction->hash,
|
||||||
'ignore' => $introduction->ignore ? 1 : 0,
|
'ignore' => $introduction->ignore ? 1 : 0,
|
||||||
|
|
|
@ -28,7 +28,6 @@ use Friendica\BaseEntity;
|
||||||
* @property-read int $cid
|
* @property-read int $cid
|
||||||
* @property-read int|null $sid
|
* @property-read int|null $sid
|
||||||
* @property-read bool $knowyou
|
* @property-read bool $knowyou
|
||||||
* @property-read bool $duplex
|
|
||||||
* @property-read string $note
|
* @property-read string $note
|
||||||
* @property-read string $hash
|
* @property-read string $hash
|
||||||
* @property-read \DateTime $datetime
|
* @property-read \DateTime $datetime
|
||||||
|
@ -45,8 +44,6 @@ class Introduction extends BaseEntity
|
||||||
protected $sid;
|
protected $sid;
|
||||||
/** @var bool */
|
/** @var bool */
|
||||||
protected $knowyou;
|
protected $knowyou;
|
||||||
/** @var bool */
|
|
||||||
protected $duplex;
|
|
||||||
/** @var string */
|
/** @var string */
|
||||||
protected $note;
|
protected $note;
|
||||||
/** @var string */
|
/** @var string */
|
||||||
|
@ -63,20 +60,18 @@ class Introduction extends BaseEntity
|
||||||
* @param int $cid
|
* @param int $cid
|
||||||
* @param int|null $sid
|
* @param int|null $sid
|
||||||
* @param bool $knowyou
|
* @param bool $knowyou
|
||||||
* @param bool $duplex
|
|
||||||
* @param string $note
|
* @param string $note
|
||||||
* @param string $hash
|
* @param string $hash
|
||||||
* @param \DateTime $datetime
|
* @param \DateTime $datetime
|
||||||
* @param bool $ignore
|
* @param bool $ignore
|
||||||
* @param int|null $id
|
* @param int|null $id
|
||||||
*/
|
*/
|
||||||
public function __construct(int $uid, int $cid, ?int $sid, bool $knowyou, bool $duplex, string $note, string $hash, \DateTime $datetime, bool $ignore, ?int $id)
|
public function __construct(int $uid, int $cid, ?int $sid, bool $knowyou, string $note, string $hash, \DateTime $datetime, bool $ignore, ?int $id)
|
||||||
{
|
{
|
||||||
$this->uid = $uid;
|
$this->uid = $uid;
|
||||||
$this->cid = $cid;
|
$this->cid = $cid;
|
||||||
$this->sid = $sid;
|
$this->sid = $sid;
|
||||||
$this->knowyou = $knowyou;
|
$this->knowyou = $knowyou;
|
||||||
$this->duplex = $duplex;
|
|
||||||
$this->note = $note;
|
$this->note = $note;
|
||||||
$this->hash = $hash;
|
$this->hash = $hash;
|
||||||
$this->datetime = $datetime;
|
$this->datetime = $datetime;
|
||||||
|
|
|
@ -39,7 +39,6 @@ class Introduction extends BaseFactory implements ICanCreateFromTableRow
|
||||||
$row['contact-id'] ?? 0,
|
$row['contact-id'] ?? 0,
|
||||||
$row['suggest-cid'] ?? null,
|
$row['suggest-cid'] ?? null,
|
||||||
!empty($row['knowyou']),
|
!empty($row['knowyou']),
|
||||||
!empty($row['duplex']),
|
|
||||||
$row['note'] ?? '',
|
$row['note'] ?? '',
|
||||||
$row['hash'] ?? '',
|
$row['hash'] ?? '',
|
||||||
new \DateTime($row['datetime'] ?? 'now', new \DateTimeZone('UTC')),
|
new \DateTime($row['datetime'] ?? 'now', new \DateTimeZone('UTC')),
|
||||||
|
@ -53,15 +52,13 @@ class Introduction extends BaseFactory implements ICanCreateFromTableRow
|
||||||
int $cid,
|
int $cid,
|
||||||
string $note,
|
string $note,
|
||||||
int $sid = null,
|
int $sid = null,
|
||||||
bool $knowyou = false,
|
bool $knowyou = false
|
||||||
bool $duplex = false
|
|
||||||
): Entity\Introduction {
|
): Entity\Introduction {
|
||||||
return $this->createFromTableRow([
|
return $this->createFromTableRow([
|
||||||
'uid' => $uid,
|
'uid' => $uid,
|
||||||
'suggest-cid' => $sid,
|
'suggest-cid' => $sid,
|
||||||
'contact-id' => $cid,
|
'contact-id' => $cid,
|
||||||
'knowyou' => $knowyou,
|
'knowyou' => $knowyou,
|
||||||
'duplex' => $duplex,
|
|
||||||
'note' => $note,
|
'note' => $note,
|
||||||
'hash' => Strings::getRandomHex(),
|
'hash' => Strings::getRandomHex(),
|
||||||
'datetime' => DateTimeFormat::utcNow(),
|
'datetime' => DateTimeFormat::utcNow(),
|
||||||
|
|
|
@ -778,7 +778,7 @@ return [
|
||||||
"contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => ""],
|
"contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => ""],
|
||||||
"suggest-cid" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Suggested contact"],
|
"suggest-cid" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Suggested contact"],
|
||||||
"knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
|
"knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
|
||||||
"duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
|
"duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "deprecated"],
|
||||||
"note" => ["type" => "text", "comment" => ""],
|
"note" => ["type" => "text", "comment" => ""],
|
||||||
"hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
|
"hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
|
||||||
"datetime" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
|
"datetime" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
|
||||||
|
|
|
@ -17,7 +17,6 @@ class IntroductionTest extends TestCase
|
||||||
'suggest-cid' => 13,
|
'suggest-cid' => 13,
|
||||||
'contact-id' => 24,
|
'contact-id' => 24,
|
||||||
'knowyou' => 1,
|
'knowyou' => 1,
|
||||||
'duplex' => 1,
|
|
||||||
'note' => 'a note',
|
'note' => 'a note',
|
||||||
'hash' => '12345',
|
'hash' => '12345',
|
||||||
'datetime' => '1970-01-01 00:00:00',
|
'datetime' => '1970-01-01 00:00:00',
|
||||||
|
@ -29,7 +28,6 @@ class IntroductionTest extends TestCase
|
||||||
'suggest-cid' => 13,
|
'suggest-cid' => 13,
|
||||||
'contact-id' => 24,
|
'contact-id' => 24,
|
||||||
'knowyou' => true,
|
'knowyou' => true,
|
||||||
'duplex' => true,
|
|
||||||
'note' => 'a note',
|
'note' => 'a note',
|
||||||
'hash' => '12345',
|
'hash' => '12345',
|
||||||
'datetime' => new \DateTime('1970-01-01 00:00:00', new \DateTimeZone('UTC')),
|
'datetime' => new \DateTime('1970-01-01 00:00:00', new \DateTimeZone('UTC')),
|
||||||
|
@ -45,7 +43,6 @@ class IntroductionTest extends TestCase
|
||||||
'contact-id' => 0,
|
'contact-id' => 0,
|
||||||
'suggest-cid' => null,
|
'suggest-cid' => null,
|
||||||
'knowyou' => false,
|
'knowyou' => false,
|
||||||
'duplex' => false,
|
|
||||||
'note' => '',
|
'note' => '',
|
||||||
'ignore' => false,
|
'ignore' => false,
|
||||||
'id' => null,
|
'id' => null,
|
||||||
|
@ -61,7 +58,6 @@ class IntroductionTest extends TestCase
|
||||||
self::assertEquals($intro->cid, $assertion['contact-id'] ?? 0);
|
self::assertEquals($intro->cid, $assertion['contact-id'] ?? 0);
|
||||||
self::assertEquals($intro->sid, $assertion['suggest-cid'] ?? null);
|
self::assertEquals($intro->sid, $assertion['suggest-cid'] ?? null);
|
||||||
self::assertEquals($intro->knowyou, $assertion['knowyou'] ?? false);
|
self::assertEquals($intro->knowyou, $assertion['knowyou'] ?? false);
|
||||||
self::assertEquals($intro->duplex, $assertion['duplex'] ?? false);
|
|
||||||
self::assertEquals($intro->note, $assertion['note'] ?? '');
|
self::assertEquals($intro->note, $assertion['note'] ?? '');
|
||||||
if (isset($assertion['hash'])) {
|
if (isset($assertion['hash'])) {
|
||||||
self::assertEquals($intro->hash, $assertion['hash']);
|
self::assertEquals($intro->hash, $assertion['hash']);
|
||||||
|
|
Loading…
Reference in a new issue