Builder::find( mixed|TECEventsCustom_TablesV1Modelsarray $value, string|null $column = null )
Find an instance of the model in the database using a specific value and column if no column is specified the primary key is used.
Contents
Parameters
- $value
-
(mixed|<span class="TECEventsCustom_TablesV1Modelsarray">TECEventsCustom_TablesV1Modelsarray) (Required) The value, or values, of the column we are looking for.
- $column
-
(string|null) (Optional) The name of the column used to compare against, primary key if not defined.
Default value: null
Return
(TECEventsCustom_TablesV1ModelsModel|null) Returns a single record where if the model is found, null otherwise.
Source
File: src/Events/Custom_Tables/V1/Models/Builder.php
public function find( $value, $column = null ) {
$column = null === $column ? $this->model->primary_key_name() : $column;
return $this->where( $column, $value )->first();
}
Changelog
| Version | Description |
|---|---|
| 6.1.3 | Added memoization behind a feature flag (default on). |
| 6.0.0 | Introduced. |