src/elements/ExplicitElementTrait.php
public static function getOne($criteria)
    {
        if (null === ($element = static::findOne($criteria))) {
            throw new ElementNotFoundException(
                sprintf(
                    "Organization not found with the following criteria: %s",
                    Json::encode($criteria)
                )
            );
        }

        return $element;
    }
public static function getOne($criteria)
    {
        if (null === ($element = static::findOne($criteria))) {
            throw new ElementNotFoundException(
                sprintf(
                    "Organization not found with the following criteria: %s",
                    Json::encode($criteria)
                )
            );
        }

        return $element;
    }
public static function getOne ( $ criteria ) { if ( null === ( $ element = static :: findOne ( $ criteria ) ) ) { throw new ElementNotFoundException ( sprintf ( "Organization not found with the following criteria: %s" , Json :: encode ( $ criteria ) ) ) ; } return $ element ; }
Returns a single element instance by a primary key or a set of element criteria parameters.

The method accepts:

- an int: query by a single ID value and return the corresponding element (or null if not found).
- an array of name-value pairs: query by a set of parameter values and return the first element
matching all of them (or null if not found).

Note that this method will automatically call the `one()` method and return an
[[ElementInterface|\craft\base\Element]] instance. For example,

```php
// find a single entry whose ID is 10
$entry = Entry::findOne(10);
// the above code is equivalent to:
$entry = Entry::find->id(10)->one();
// find the first user whose email ends in "example.com"
$user = User::findOne(['email' => '*example.com']);
// the above code is equivalent to:
$user = User::find()->email('*example.com')->one();
```

@param mixed $criteria The element ID or a set of element criteria parameters
@return static Element instance matching the condition, or null if nothing matches.
@throws ElementNotFoundException
Returns a single element instance by a primary key or a set of element criteria parameters .