Initial import
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\models;
|
||||
|
||||
/**
|
||||
* Class Projects
|
||||
* @package app\models
|
||||
* @property $id
|
||||
* @property $title
|
||||
* @property $text
|
||||
* @property $text_short
|
||||
* @property $text_contract
|
||||
* @property $ts_en_tile
|
||||
* @property $ts_en_text
|
||||
* @property $ts_en_text_short
|
||||
* @property $ts_en_contract
|
||||
* @property $period
|
||||
* @property $website
|
||||
* @property $publications
|
||||
* @property $media_key
|
||||
* @property $document_key
|
||||
* @property $projectPartners
|
||||
* @property $is_for_publish
|
||||
*/
|
||||
class Projects extends _Base
|
||||
{
|
||||
public function getProjectPartners() {
|
||||
return $this->hasMany(ProjectsPartner::class, ['project_id' => 'id']);
|
||||
}
|
||||
|
||||
public function partnersIds() {
|
||||
$ids = [];
|
||||
/** @var \app\models\ProjectsPartner $partner */
|
||||
foreach ($this->projectPartners as $partner) {
|
||||
$ids[] = $partner->partner_id;
|
||||
}
|
||||
return $ids;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user