本文整理汇总了PHP中Manager::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Manager::get方法的具体用法?PHP Manager::get怎么用?PHP Manager::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Manager
的用法示例。
在下文中一共展示了Manager::get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
/**
* @param string $class
* @param string $method
*/
function __construct(Manager $manager, $class, $method)
{
$this->class = $class;
$this->method = $method;
$inspector = $manager->get('Cti\\Di\\Inspector');
$this->arguments = $inspector->getMethodArguments($class, $method);
$this->requiredCount = $inspector->getMethodRequiredCount($class, $method);
}
示例2: getInstance
/**
* @param Manager $manager
* @return object
*/
function getInstance(Manager $manager)
{
return $manager->get($this->class);
}
示例3: self
//.........这里部分代码省略.........
$s->last_name = 'Thomas';
$s->position = 'Supervisor';
$s->save();
$s = new Supervisor();
$s->first_name = 'Sarah';
$s->last_name = 'Parker';
$s->position = 'Supervisor';
$s->save();
// Create Underlings
$u = new Underling();
$u->first_name = 'Fred';
$u->last_name = 'Smith';
$u->position = 'Underling';
$u->save();
$u = new Underling();
$u->first_name = 'Jayne';
$u->last_name = 'Doe';
$u->position = 'Underling';
$u->save();
$u = new Underling();
$u->first_name = 'Joe';
$u->last_name = 'Public';
$u->position = 'Underling';
$u->save();
$u = new Underling();
$u->first_name = 'Sam';
$u->last_name = 'Rogers';
$u->position = 'Underling';
$u->save();
echo '<hr />';
echo '<p>Now we\'ll set up some relationships.</p>';
echo '<code>// Get the first Supervisor<br />
$s = new Supervisor();<br />
$s->get(1);<br />
<br />
// Get first 2 Underlings<br />
$u = new Underling();<br />
$u->get(2);<br />
<br />
// Setup Supervisor to supervise those Underlings<br />
$s->save($u->all);<br />
<br />
<br />
// Get the second Supervisor<br />
$s = new Supervisor();<br />
$s->get(1, 1);<br />
<br />
// Get the other 2 Underlings<br />
$u = new Underling();<br />
$u->get(2, 2);<br />
<br />
// Setup Supervisor to supervise those Underlings<br />
$s->save($u->all);<br />
<br />
<br />
// Get the Manager<br />
$m = new Manager();<br />
$m->get();<br />
<br />
// Get the Supervisors<br />
$s = new Supervisor();<br />
$s->get();<br />
<br />
// Setup Manager to manage those Supervisors<br />
$m->save($s->all);</code>';
// Get the first Supervisor
示例4: testGet
/**
* Tests Manager->get()
*/
public function testGet()
{
$this->assertEquals(__NAMESPACE__ . __CLASS__ . __FUNCTION__ . 'MyVar', $this->Manager->get(md5(microtime()), __NAMESPACE__ . __CLASS__ . __FUNCTION__ . 'MyVar'));
}