elektronika_bagisto/packages/Webkul/Channel/src/Channel.php

27 lines
603 B
PHP
Raw Normal View History

2018-07-24 11:11:32 +00:00
<?php
namespace Webkul\Channel;
use Webkul\Channel\Models\Channel as ChannelModel;
class Channel
{
2018-07-27 06:22:12 +00:00
public function getDefaultChannelLocaleCode() {
$channel = ChannelModel::first();
if(!$channel || !$channel->locales()->count())
return;
return $channel->code . '-' . $channel->locales()->first()->code;
}
2018-07-24 11:11:32 +00:00
public function getDefaultChannelLocale() {
$channel = ChannelModel::first();
2018-07-27 06:22:12 +00:00
return $channel->locales()->first();
}
public function getChannelWithLocales() {
return ChannelModel::with('locales')->get();
2018-07-24 11:11:32 +00:00
}
}