Свойство | Тип | Описание | |
---|---|---|---|
$errors | Illuminate\Support\MessageBag | Error message bag. | |
$localMock | Public local mock. | ||
$mock | Public static mock. | ||
$rules | array | Validation rules. |
Свойство | Тип | Описание | |
---|---|---|---|
$hashedAttributes | array | List of attribute names which should be hashed on save. For example: array('password');. |
Метод | Описание | |
---|---|---|
__callStatic ( string $name, array $arguments ) : |
Initiate a mock expectation on the facade. | |
all ( ) | ||
delete ( ) : boolean | Overwrites the delete method in order to be able to check for the expectation in the localMock in order to call the delete method into the existing mock and avoid touching the database. | |
errors ( ) : Illuminate\Support\MessageBag | Get the contents of errors attribute. | |
first ( mixed $query = [], array $projection = [], boolean $useCache = false ) : |
Gets the first entity of this kind that matches the query. | |
firstOrFail ( mixed $query = [], array $projection = [], boolean $useCache = false ) : |
Gets the first entity of this kind that matches the query. If no document was found, throws ModelNotFoundException. | |
firstOrNew ( mixed $id ) : |
Gets the first entity of this kind that matches the query. If no document was found, a new entity will be returned with the _id field filled. | |
isValid ( ) : boolean | Verify if the model is valid by running its validation rules, defined on static attribute $rules. | |
save ( boolean $force = false ) : boolean | Save the model to the database if it's valid. This method also checks for the presence of the localMock in order to call the save method into the existing Mock in order not to touch the database. | |
shouldReceiveDelete ( ) : |
Initiate a mock expectation that is specific for the delete method. | |
shouldReceiveSave ( ) : |
Initiate a mock expectation that is specific for the save method. | |
update ( ) | ||
where ( array $query = [], array $projection = [], boolean $useCache = false ) : |
Gets a cursor of this kind of entities that matches the query from the database. |
Метод | Описание | |
---|---|---|
callMockOrParent ( string $method, array $arguments ) : mixed | Calls mock method if its have expectations. Calls parent method otherwise. | |
collection ( ) : MongoDB\Collection | Returns the Mongo collection object. | |
db ( ) : MongoDB\Database | Returns the database object (the connection). | |
getLocalMock ( ) : |
Get a local mock instance. | |
hasLocalMock ( ) : boolean | Check if local mock is set. | |
hashAttributes ( ) : void | Hashes the attributes specified in the hashedAttributes array. | |
localMockHasExpectationsFor ( string $method ) : boolean | Check for a expectation for given method on local mock. | |
localMockShouldReceive ( string $method ) : |
Initiate a mockery expectation that is specific for the given method. |
protected collection ( ) : MongoDB\Collection | ||
Результат | MongoDB\Collection |
protected db ( ) : MongoDB\Database | ||
Результат | MongoDB\Database |
public errors ( ) : Illuminate\Support\MessageBag | ||
Результат | Illuminate\Support\MessageBag | Validation errors |
public static first ( mixed $query = [], array $projection = [], boolean $useCache = false ) : |
||
$query | mixed | MongoDB selection criteria. |
$projection | array | Fields to project in MongoDB query. |
$useCache | boolean | Retrieves the entity through a CacheableCursor. |
Результат |
public static firstOrFail ( mixed $query = [], array $projection = [], boolean $useCache = false ) : |
||
$query | mixed | MongoDB selection criteria. |
$projection | array | Fields to project in Mongo query. |
$useCache | boolean | Retrieves the entity through a CacheableCursor. |
Результат |
public static firstOrNew ( mixed $id ) : |
||
$id | mixed | Document id. |
Результат |
protected getLocalMock ( ) : |
||
Результат |
protected hasLocalMock ( ) : boolean | ||
Результат | boolean |
protected hashAttributes ( ) : void | ||
Результат | void |
protected localMockHasExpectationsFor ( string $method ) : boolean | ||
$method | string | Name of the method being checked. |
Результат | boolean |
protected localMockShouldReceive ( string $method ) : |
||
$method | string | Name of the method being mocked. |
Результат |
public shouldReceiveDelete ( ) : |
||
Результат |
public shouldReceiveSave ( ) : |
||
Результат |
public MessageBag,Illuminate\Support $errors | ||
Результат | Illuminate\Support\MessageBag |
protected array $hashedAttributes | ||
Результат | array |
public Mock,Mockery $localMock | ||
Результат |
public static Mock,Mockery $mock | ||
Результат |