-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFacebookAdapterAwareTrait.php
42 lines (36 loc) · 1.09 KB
/
FacebookAdapterAwareTrait.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
namespace Laelaps\Bundle\Facebook;
use BadMethodCallException;
/**
* This trait is a minimal implementation of FacebookAdapterAwareInterface
*/
trait FacebookAdapterAwareTrait
{
/**
* @var \Laelaps\Bundle\Facebook\FacebookAdapter
*/
private $facebookAdapter;
/**
* @api
* @return \Laelaps\Bundle\Facebook $facebookAdapter
* @throws \BadMethodCallException If FacebookAdapter is not set
* @see \Laelaps\Bundle\Facebook\FacebookAdapterAwareInterface::getFacebookAdapter
*/
public function getFacebookAdapter()
{
if (!($this->facebookAdapter instanceof FacebookAdapter)) {
throw new BadMethodCallException('FacebookAdapter is not set.');
}
return $this->facebookAdapter;
}
/**
* @api
* @param \Laelaps\Bundle\Facebook $facebookAdapter
* @return void
* @see \Laelaps\Bundle\Facebook\FacebookAdapterAwareInterface::setFacebookAdapter
*/
public function setFacebookAdapter(FacebookAdapter $facebookAdapter = null)
{
$this->facebookAdapter = $facebookAdapter;
}
}