Look up the id of an existing subscriber.

@param array $attributes An array of attribute to look up the subscriber with
@return mixed Either the subscriber id, or false if the subscriber is not found
@access public
420153
public function Subscriber_Get_Id($attributes) {
        try {
            $ret = $this->Subscriber_Lookup($attributes);
            $uri = $ret->uri;
            $id = (int) substr(strrchr($uri, '/'), 1);
        } catch (\Exception $e) {
            if( $e->getCode() === 404){
                $id = false;
            } else {
                throw $e;
            }
        }

        return $id;
    }
428833
protected function attributes($attributes)
    {
        if (!is_array($attributes)) {
            return $attributes;
        }

        $attr = '';
        foreach ($attributes as $attribute => $value) {
            if (is_int($attribute)) {
                $attribute = $value;
            }
            $attr .= ' ' . $attribute . '="' . $value . '"';
        }

        return $attr;
    }
964902
private function getAttributeId($attribute)
    {
        $attributeId = $attribute;

        if (is_object($attribute)) {
            $attributeId = $attribute->getAttributeId();
        }

        return $attributeId;
    }
507119
protected function store(array $attributes)
    {
        $identityObject = new AuthenticationIdentity($attributes);
        $this->sessionScope->set('identity', $identityObject);
        $this->sessionScope->set('authenticated', true);

        return $attributes;
    }
711147
public function setSubscribers($subscribers)
    {
        //flatten the array
        $subscribers = AnHelperArray::getValues(AnConfig::unbox($subscribers));
        $ids = array();

        foreach ($subscribers as $subscriber) {
            if (is($subscriber, 'AnDomainEntityAbstract')) {
                $ids[] = $subscriber->id;
            } else {
                $ids[] = $subscriber;
            }
        }

        $ids = array_unique($ids);

        if (!empty($ids)) {
            $this->set('subscriberIds', AnDomainAttribute::getInstance('set')->setData($ids));
        } else {
            $this->delete();
        }

        return $this;
    }
780608
public function matchSingleResult(array $attributes) : array
    {
        return $this->asArray ? $this->matchAsArray($attributes) : $this->matchAsAttributes($attributes);
    }
766140
public function find($id, $attributes = ['*'])
    {
        return $this->executeCallback(get_called_class(), __FUNCTION__, func_get_args(), function () use ($id, $attributes) {
            return $this->prepareQuery($this->createModel())->find($id, $attributes);
        });
    }
672880
public function haveAllRequiredAttributes( array $attributes ) : bool
   {

      foreach ( $this->_attributes as $attribute )
      {
         if ( ! $attribute->isRequired() )
         {
            continue;
         }
         if ( ! isset( $attributes[ $attribute->getName() ] ) )
         {
            if ( $attribute->hasValueMissedLink() && $attribute->getValueMissedLink()->isValid() )
            {
               continue;
            }
            return false;
         }
      }

      return true;

   }
501542
public function getAssignedOCLs($attribute)
    {
        $may  = array();
        $must = array();

        // Test if the attribute type is defined in the schema,
        // if so, retrieve real name for lookups
        $attr_entry = $this->get('attribute', $attribute);
        if ($attr_entry instanceof Net_LDAP2_ERROR) {
            return PEAR::raiseError("Attribute $attribute not defined in schema: ".$attr_entry->getMessage());
        } else {
            $attribute = $attr_entry['name'];
        }


        // We need to get all defined OCLs for this.
        $ocls = $this->getAll('objectclasses');
        foreach ($ocls as $ocl => $ocl_data) {
            // Fetch the may and must attrs and see if our searched attr is contained.
            // If so, record it in the corresponding array.
            $ocl_may_attrs  = $this->may($ocl);
            $ocl_must_attrs = $this->must($ocl);
            if (is_array($ocl_may_attrs) && in_array($attribute, $ocl_may_attrs)) {
                array_push($may, $ocl_data['name']);
            }
            if (is_array($ocl_must_attrs) && in_array($attribute, $ocl_must_attrs)) {
                array_push($must, $ocl_data['name']);
            }
        }

        return array('may' => $may, 'must' => $must);
    }
676701
public function sendSubscribeRequest($attributes)
    {
        $token = isset($attributes['access_token']) ? $attributes['access_token'] : $this->getAccessToken();
        
        $page_id = $attributes['page_id'];
        $end_point = $this->getResource() . '/' . $page_id . '/subscribed_apps?access_token=' . $token;

        return giga_remote_post($end_point, [
            'subscribed_fields' => $attributes['subscribed_fields']
        ]);
    }
20688
public function map(array $attributes)
    {
        foreach ($attributes as $key => $value) {
            $this->{$key} = $value;
        }

        return $this;
    }
458013
public function setIdentityAttributes(array $attributes)
    {
        $allowedAttributes = $this->identityAttributesMap();
        foreach ($attributes as $name => $value) {
            if (isset($allowedAttributes[$name])) {
                $key = $allowedAttributes[$name];
                $this->$key = $value;
            }
        }

        return true;
    }
125083
public function getByAttributes(array $attributes) : ?Model
    {
        if (empty($attributes)) {
            return null;
        }

        // First we will add each credential element to the query as a where clause.
        // Then we can execute the query and, if we found a user, return it in a
        // Eloquent User "model" that will be utilized by the Guard instances.
        $query = $this->getModel()->newQuery();

        foreach ($attributes as $key => $value) {
            $query->where($key, $value);
        }

        return $query->first();
    }
420626
public function id(array $values)
    {
        $count = count($values);
        $ids = array_filter($values, 'ctype_digit');

        if ($count != count($ids)) {
            return $this->translation->text('@field has invalid value', array(
                '@field' => $this->translation->text('Condition')));
        }

        $existing = array_filter($values, function ($product_id) {
            $product = $this->product->get($product_id);
            return isset($product['product_id']);
        });

        if ($count != count($existing)) {
            return $this->translation->text('@name is unavailable', array(
                '@name' => $this->translation->text('Product')));
        }

        return true;
    }
393689
public function firstOrNew(array $attributes)
    {
        if (is_null($instance = $this->where($attributes)->first())) {
            $instance = $this->related->newInstance($attributes);

            $instance->setAttribute($this->getForeignKeyName(), $this->getParentKey());
        }

        return $instance;
    }
301990
public function getOrCreate(array $attributes)
    {
        $model = $this->get($attributes);
        if (null === $model) {
            $className = get_class($this->getModel());
            /** @var Model $model */
            $model = new $className($attributes);
            $model->save();

            return [$model, true];
        }

        return [$model, false];
    }
733247
public function getSubscription()
    {
        if (null === $this->_subscription) {
            $this->_subscription = Subscription::find()->id($this->subscriptionId)->one();
        }

        return $this->_subscription;
    }