PHP 클래스 LaravelFCM\Message\Topics

Create topic or a topic condition
파일 보기 프로젝트 열기: brozot/laravel-fcm 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$conditions of element in the condition

공개 메소드들

메소드 설명
andTopic ( string | Closur\Closure $first ) : Topics Add a and condition to the precedent topic set
build ( ) : array | string Transform to array
hasOnlyOneTopic ( ) : boolean Check if only one topic was set
nest ( Closure $callback, $condition )
orTopic ( string | Closur\Closure $first ) : Topics Add a or condition to the precedent topic set
topic ( string $first ) Add a topic, this method should be called before any conditional topic

비공개 메소드들

메소드 설명
checkIfOneTopicExist ( )
on ( $first, $condition )
topicsForFcm ( $conditions ) : string

메소드 상세

andTopic() 공개 메소드

Parenthesis is a closure Equivalent of this: **'TopicA' in topic' && 'TopicB' in topics** $topic = new Topics(); $topic->topic('TopicA') ->anTopic('TopicB'); Equivalent of this: **'TopicA' in topics || ('TopicB' in topics && 'TopicC' in topics)** $topic = new Topics(); $topic->topic('TopicA') ->orTopic(function($condition) { $condition->topic('TopicB')->AndTopic('TopicC'); }); > Note: Only two operators per expression are supported by fcm
public andTopic ( string | Closur\Closure $first ) : Topics
$first string | Closur\Closure topicName or closure
리턴 Topics

build() 공개 메소드

Transform to array
public build ( ) : array | string
리턴 array | string

hasOnlyOneTopic() 공개 메소드

Check if only one topic was set
public hasOnlyOneTopic ( ) : boolean
리턴 boolean

nest() 공개 메소드

public nest ( Closure $callback, $condition )
$callback Closure
$condition

orTopic() 공개 메소드

Parenthesis is a closure Equivalent of this: **'TopicA' in topic' || 'TopicB' in topics** $topic = new Topics(); $topic->topic('TopicA') ->orTopic('TopicB'); Equivalent of this: **'TopicA' in topics && ('TopicB' in topics || 'TopicC' in topics)** $topic = new Topics(); $topic->topic('TopicA') ->andTopic(function($condition) { $condition->topic('TopicB')->orTopic('TopicC'); }); > Note: Only two operators per expression are supported by fcm
public orTopic ( string | Closur\Closure $first ) : Topics
$first string | Closur\Closure topicName or closure
리턴 Topics

topic() 공개 메소드

Add a topic, this method should be called before any conditional topic
public topic ( string $first )
$first string topicName

프로퍼티 상세

$conditions 공개적으로 프로퍼티

of element in the condition
public $conditions