This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
... | |
public function relations() { | |
return array( | |
'childModels' => array(self::HAS_MANY, 'ChildModel', 'parent_model_id') | |
); | |
} | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
... | |
public function relations() { | |
return array( | |
'childModels' => array(self::HAS_MANY, 'application\models\ChildModel', 'parent_model_id') | |
); | |
} | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
... | |
public function relations() { | |
return array( | |
'ParentModel' => array(self::BELONGS_TO, 'application\models\ParentModel', 'parent_model_id') | |
); | |
} | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class HelloJob implements Job | |
{ | |
public function perform() | |
{ | |
echo "Hello world"; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Defines a php-resque job | |
*/ | |
interface Job | |
{ | |
/** | |
* Executes the job |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Resque::enqueue("default", 'application\models\jobs\TestJob', array("arg1" => "myArg1"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Display filters | |
add_filter( 'the_title', 'wptexturize' ); | |
add_filter( 'the_title', 'convert_chars' ); | |
add_filter( 'the_title', 'trim' ); | |
add_filter( 'the_content', 'wptexturize' ); | |
add_filter( 'the_content', 'convert_smilies' ); | |
add_filter( 'the_content', 'convert_chars' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UserDao userDao = Mockito.mock(UserDao.class); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mockito.when(userDao.getUserById(1L)).thenReturn(new User("Mario")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mockito.when(userDao.getUserById(111)).thenThrow(new NoResultException()); |