23 lines
433 B
PHP
23 lines
433 B
PHP
<?php
|
|
|
|
class PhotoLinks extends Model
|
|
{
|
|
function __construct($fromArray = array())
|
|
{
|
|
$this->_tableName_ = 'photoLinks';
|
|
parent::__construct($fromArray);
|
|
}
|
|
|
|
static function model()
|
|
{
|
|
return new self();
|
|
}
|
|
|
|
static function addLink($photo, $url)
|
|
{
|
|
$parsedUrl = parse_url($url);
|
|
App::DB()->query('INSERT INTO photoLinks VALUES ("'.$photo.'","'.$url.'","'.$parsedUrl['host'].'") ON DUPLICATE KEY UPDATE url=url;');
|
|
}
|
|
}
|
|
|