ActionScheduler_HybridStore::get_store_from_action_id()
Return which store an action is stored in.
Метод класса: ActionScheduler_HybridStore{}
Хуков нет.
Возвращает
ActionScheduler_Store
.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_store_from_action_id( $action_id, $primary_first );
- $action_id(int) (обязательный)
- ID of the action.
- $primary_first(true|false)
- Optional flag indicating search the primary store first.
По умолчанию: false
Код ActionScheduler_HybridStore::get_store_from_action_id() ActionScheduler HybridStore::get store from action id WC 8.7.0
protected function get_store_from_action_id( $action_id, $primary_first = false ) { if ( $primary_first ) { $stores = [ $this->primary_store, $this->secondary_store, ]; } elseif ( $action_id < $this->demarkation_id ) { $stores = [ $this->secondary_store, $this->primary_store, ]; } else { $stores = [ $this->primary_store, ]; } foreach ( $stores as $store ) { $action = $store->fetch_action( $action_id ); if ( ! is_a( $action, 'ActionScheduler_NullAction' ) ) { return $store; } } return null; }